Skip to content

[spark] Fix a shifted timestamp written from before a zone left local mean time - #10117

Open
cxzl25 wants to merge 1 commit into
apache:masterfrom
cxzl25:spark-pre1900-timestamp-write
Open

cxzl25 wants to merge 1 commit into
apache:masterfrom
cxzl25:spark-pre1900-timestamp-write

Conversation

@cxzl25

@cxzl25 cxzl25 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Purpose

SET spark.sql.datetime.java8API.enabled = false;
SET spark.sql.session.timeZone = Asia/Shanghai;

CREATE TABLE t (id INT, ts TIMESTAMP) USING paimon;
INSERT INTO t VALUES (1, timestamp'1900-01-01 00:00:00');
SELECT cast(ts as string) FROM t;

-- before this change: 1900-01-01 00:05:43
-- with this change:   1900-01-01 00:00:00

Tests

Add UT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant