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

Support yyyyMMdd in GetTimestamp operator for LEGACY mode [databricks] #11449

Open
wants to merge 3 commits into
base: branch-24.10
Choose a base branch
from

Conversation

res-life
Copy link
Collaborator

@res-life res-life commented Sep 9, 2024

closes #11445

This PR supports yyyyMMdd in GetTimestamp operator for LEGACY mode
Note: this PR introduced inconsistent behavior compared to Spark:

Spark behavior:

  "20240101"  =>  2024-01-01
  "202401 01" =>  2024-01-01
  "2024 0101" =>  invalid
  "202411"    =>  invalid
  "2024101"   =>  2024-10-01  // Note: 10-01 not 01-01
  "202411"    =>  invalid

GPU only support 8 digit strings.

Signed-off-by: Chong Gao <res_life@163.com>
@res-life
Copy link
Collaborator Author

res-life commented Sep 9, 2024

build

@res-life res-life changed the title Support yyyyMMdd in GetTimestamp operator for LEGACY mode Support yyyyMMdd in GetTimestamp operator for LEGACY mode [databricks] Sep 9, 2024
@res-life res-life marked this pull request as ready for review September 9, 2024 09:57
revans2
revans2 previously approved these changes Sep 9, 2024
@res-life
Copy link
Collaborator Author

Building failed due to #11436

Errors:
[2024-09-09T10:14:38.020Z] - extract mortgage data *** FAILED ***
[2024-09-09T10:14:38.021Z] 0 did not equal 10000 (MortgageSparkSuite.scala:65)

@firestarman
Copy link
Collaborator

firestarman commented Sep 10, 2024

Looks like this change will also enable yyyyMMdd support for all the relevant date time expressions, e.g. from_unix, data_format ...
We may need tests for them too.

@res-life
Copy link
Collaborator Author

build

@sameerz sameerz added the feature request New feature or request label Sep 15, 2024
@res-life
Copy link
Collaborator Author

Looks like this change will also enable yyyyMMdd support for all the relevant date time expressions, e.g. from_unix, data_format ... We may need tests for them too.

Updated cases.

@res-life
Copy link
Collaborator Author

build

assert_gpu_and_cpu_are_equal_sql(
lambda spark : unary_op_df(spark, gen),
"tab",
"select unix_timestamp(a, 'yyyyMMdd'), from_unixtime(unix_timestamp(a, 'yyyyMMdd'), 'yyyyMMdd'), date_format(to_timestamp(a, 'yyyyMMdd'), 'yyyyMMdd') from tab",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider using multi-line strings

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@firestarman
Copy link
Collaborator

Looks good to me.

@res-life
Copy link
Collaborator Author

build

@res-life
Copy link
Collaborator Author

Spark 400 building failure is related to #11479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Support format 'yyyyMMdd' in GetTimestamp operator
5 participants