Skip to content

[SPARK-55995][SQL] Support TIMESTAMP WITH LOCAL TIME ZONE in SQL syntax#54813

Open
pan3793 wants to merge 1 commit intoapache:masterfrom
pan3793:SPARK-55995
Open

[SPARK-55995][SQL] Support TIMESTAMP WITH LOCAL TIME ZONE in SQL syntax#54813
pan3793 wants to merge 1 commit intoapache:masterfrom
pan3793:SPARK-55995

Conversation

@pan3793
Copy link
Member

@pan3793 pan3793 commented Mar 15, 2026

What changes were proposed in this pull request?

This PR proposes to add SQL syntax TIMESTAMP WITH LOCAL TIME ZONE for TimestampType, as a counterpart of TIMESTAMP WITHOUT TIME ZONE for TimestampNTZType.

Why are the changes needed?

Spark SQL supports TIMESTAMP_LTZ as a counterpart of TIMESTAMP_NTZ, but lacks support
TIMESTAMP WITH LOCAL TIME ZONE as a counterpart of TIMESTAMP WITHOUT TIME ZONE.

-- fine
CREATE TABLE ts_1(ltz TIMESTAMP, ntz TIMESTAMP_NTZ);

-- fine, equivalent to the above case
CREATE TABLE ts_2(ltz TIMESTAMP, ntz TIMESTAMP WITHOUT TIME ZONE);

-- set TIMESTAMP as alias of TIMESTAMP_NTZ
SET spark.sql.timestampType=TimestampNTZ;

-- fine, both are TimestampNTZ
CREATE TABLE ts_3(ltz TIMESTAMP, ntz TIMESTAMP_NTZ);

-- fine, one Timestamp, and one TimestampNTZ
CREATE TABLE ts_4(ltz TIMESTAMP_LTZ, ntz TIMESTAMP_NTZ);

-- this does not work
CREATE TABLE ts_5(ltz TIMESTAMP WITH LOCAL TIME ZONE, ntz TIMESTAMP WITHOUT TIME ZONE);

Does this PR introduce any user-facing change?

This introduces new SQL syntax without breaking backward compatibility.

How was this patch tested?

New UTs are added.

Was this patch authored or co-authored using generative AI tooling?

No.

@pan3793 pan3793 requested a review from gengliangwang March 15, 2026 19:57
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