Skip to content

[BUG][Spark] Syntax Error with Convert to Delta with a Partitioned By on Timestamp Column, works on date #4441

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

Open
2 of 8 tasks
kaushikjnayak opened this issue Apr 19, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@kaushikjnayak
Copy link

Bug

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

Describe the problem

CONVERT TO DELTA fails with Syntax Error when we add a TIMESTAMP column in the PARTITIONED BY clause. When I change it to date it works.

Steps to reproduce

  1. Copy parquet Files produced by Spark .write.format("parquet").partitionBy on a timestamp column into a folder in AWS S3. eg parquet_path/event_time_partition=2025-02-19 13%3A00%3A00
  2. Run in spark.sql with Delta configurations.
CONVERT TO DELTA parquet.`s3://bucket/path/to/parquet_path` PARTITIONED BY ( event_timestamp timestamp)

  1. Change timestamp to date, it works(not intended)
CONVERT TO DELTA parquet.`s3://bucket/path/to/parquet_path` PARTITIONED BY ( event_timestamp date)

Observed results

ParseException: 
[PARSE_SYNTAX_ERROR] Syntax error at or near 'CONVERT'.(line 1, pos 0)

== SQL ==
CONVERT TO DELTA parquet.`s3://bucket/path/to/parquet_path` PARTITIONED BY ( event_timestamp timestamp)
^^^

Expected results

I want to know if this is unsupported. If yes, it should be correctly indicated. Now it is confusing. Also, If I change timestamp to date type it works but that is not the expectation.

Further details

Environment information

  • Delta Lake version: 3.2.0
  • Spark version: 3.5.1
  • Scala version: 2.12

Willingness to contribute

The Delta Lake Community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the Delta Lake code base?

  • Yes. I can contribute a fix for this bug independently.
  • Yes. I would be willing to contribute a fix for this bug with guidance from the Delta Lake community.
  • No. I cannot contribute a bug fix at this time.
@kaushikjnayak kaushikjnayak added the bug Something isn't working label Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant