Skip to content

[SPARK-51563][SQL] Support the fully qualified type name TIME(n) WITHOUT TIME ZONE #51177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Jun 13, 2025

What changes were proposed in this pull request?

In the PR, I propose to recognize the optional suffix WITHOUT TIME ZONE of the type TIME(n), and consider TIME(n) WITHOUT TIME ZONE and TIME(n) as synonyms.

Why are the changes needed?

To conform to the ANSI SQL standard.

Does this PR introduce any user-facing change?

No. It just extends the existing syntax.

How was this patch tested?

By running the affected test suites:

$ build/sbt "test:testOnly *DataTypeParserSuite"
$ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z keywords.sql"
$ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z keywords-enforced.sql"

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

No.

@github-actions github-actions bot added the SQL label Jun 13, 2025
@MaxGekk MaxGekk changed the title [WIP][SQL] Recognize the optional suffix WITHOUT TIME ZONE of the TIME type [WIP][SPARK-51563][SQL] Support the fully qualified type name TIME(n) WITHOUT TIME ZONE Jun 13, 2025
@github-actions github-actions bot added the DOCS label Jun 13, 2025
@MaxGekk MaxGekk changed the title [WIP][SPARK-51563][SQL] Support the fully qualified type name TIME(n) WITHOUT TIME ZONE [SPARK-51563][SQL] Support the fully qualified type name TIME(n) WITHOUT TIME ZONE Jun 13, 2025
@MaxGekk MaxGekk marked this pull request as ready for review June 13, 2025 20:44
@MaxGekk
Copy link
Member Author

MaxGekk commented Jun 13, 2025

@srielau @cloud-fan Please, have a look at the PR.

Copy link
Contributor

@srielau srielau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Should we add this to TIMESTAMP as well, as an equivalent for TIMESTAMP_NTZ)?

@MaxGekk
Copy link
Member Author

MaxGekk commented Jun 14, 2025

Merging to master. Thank you, @srielau and @LuciferYang for review.

@MaxGekk MaxGekk closed this in bbc8043 Jun 14, 2025
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Thank you, @MaxGekk .

@cloud-fan
Copy link
Contributor

late LGTM

@MaxGekk
Copy link
Member Author

MaxGekk commented Jun 16, 2025

LGTM. Should we add this to TIMESTAMP as well, as an equivalent for TIMESTAMP_NTZ)?

I have opened the PR for that: #51181

MaxGekk added a commit that referenced this pull request Jun 17, 2025
### What changes were proposed in this pull request?
In the PR, I propose to introduce a synonym for the existing type `TIMESTAMP_NTZ` as the SQL standard defines: `TIMESTAMP WITHOUT TIME ZONE`.

### Why are the changes needed?
- To conform to the SQL standard
- To simplify migration from other systems that recognize the fully qualified type name.
- To be consistent with the `TIME` type, see #51177

### Does this PR introduce _any_ user-facing change?
No, it just extends the existing syntax.

### How was this patch tested?
By running the modified test suite:
```
$ build/sbt "test:testOnly *DataTypeParserSuite"
```

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

Closes #51181 from MaxGekk/timestamp-without-timezone.

Authored-by: Max Gekk <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants