Skip to content
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

feat: Disable cast string to timestamp by default #337

Merged
merged 8 commits into from
Apr 29, 2024

Conversation

andygrove
Copy link
Member

Which issue does this PR close?

Related to #328

Rationale for this change

Casting from string to timestamp can cause incorrect results especially regarding timezone and could potentially lead to data corruption. We should disable it by default until we have fixed #328

What changes are included in this PR?

  • Add a config to enable/disable support for cast string to timestamp
  • Add check in query plan serde

How are these changes tested?

New test added

@andygrove andygrove changed the title Disable cast string to timestamp by default feat: Disable cast string to timestamp by default Apr 28, 2024
Copy link
Contributor

@vaibhawvipul vaibhawvipul left a comment

Choose a reason for hiding this comment

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

This is good.

@andygrove andygrove merged commit e90d484 into apache:main Apr 29, 2024
28 checks passed
@andygrove andygrove deleted the cast-string-to-timestamp-conf branch April 29, 2024 13:37
@@ -365,6 +365,13 @@ object CometConf {
.booleanConf
.createWithDefault(false)

val COMET_CAST_STRING_TO_TIMESTAMP: ConfigEntry[Boolean] = conf(
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if we should have this configuration at all? If users turn this on they could end up with incorrect data?

himadripal pushed a commit to himadripal/datafusion-comet that referenced this pull request Sep 7, 2024
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.

Implement Spark-compatible CAST from String to Timestamp
4 participants