-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-4508] [SQL] build native date type to conform behavior to Hive #3732
Conversation
Test build #24576 has started for PR 3732 at commit
|
Test build #24576 has finished for PR 3732 at commit
|
Test FAILed. |
Test build #24579 has started for PR 3732 at commit
|
Test build #24579 has finished for PR 3732 at commit
|
Test PASSed. |
6ef2b1f
to
3b4d5d8
Compare
Test build #24862 has started for PR 3732 at commit
|
Test build #24862 has finished for PR 3732 at commit
|
Test FAILed. |
Test build #24882 has started for PR 3732 at commit
|
Test build #24882 has finished for PR 3732 at commit
|
Test PASSed. |
I'm a little confused about what semantics various systems are providing here. Does java.sql.Data provide greater precision that hive? If so, I'm not sure if we want to aim for the lowest common denominator. Can you investigate how other systems handle this? |
d66b01c
to
2c2bda4
Compare
Test build #25022 has started for PR 3732 at commit
|
Hi @marmbrus I have tried MySQL, and MySQL will treat cast('2015-01-03 18:25:04' as date) == cast('2015-01-03 18:29:02' as date), there is such a precision lost. |
The code seems conflict now, I have just rebased |
Test build #25022 has finished for PR 3732 at commit
|
Test PASSed. |
and MySQL doesn't allow to cast date back to timestamp type |
For oracle's doc about For SQL-92 spec, http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt
The spec also clarifies that the definition is taken from ISO-8601[http://www.w3.org/TR/NOTE-datetime], in which it says, Hence, the time part of |
Hmm, okay. Thanks for doing the research! Can you fix the conflict so we can merge please? /cc @rxin more api considerations... |
Actually can we merge this after we merge #3958 ? So @adrian-wang you will likely need to do a slightly larger rebase (should still be straightforward though). |
Sure, I'll wait #3958 till it is merged. |
2c2bda4
to
810c8c3
Compare
@adrian-wang #3958 has been merged. Can you bring this PR up to date? |
Test build #25525 has started for PR 3732 at commit
|
Yes, I have just done the rebasing. |
Test build #26213 has started for PR 3732 at commit
|
Test build #26215 has started for PR 3732 at commit
|
Test build #26213 has finished for PR 3732 at commit
|
Test FAILed. |
Test build #26215 has finished for PR 3732 at commit
|
Test FAILed. |
Test build #26216 has started for PR 3732 at commit
|
Test build #26210 has finished for PR 3732 at commit
|
Test PASSed. |
Test build #26216 has finished for PR 3732 at commit
|
Test PASSed. |
Thanks! Merging to master. |
The previous #3732 is reverted due to some test failure. Have fixed that. Author: Daoyuan Wang <[email protected]> Closes #4325 from adrian-wang/datenative and squashes the following commits: 096e20d [Daoyuan Wang] fix for mixed timezone 0ed0fdc [Daoyuan Wang] fix test data a2fdd4e [Daoyuan Wang] getDate c37832b [Daoyuan Wang] row to catalyst f0005b1 [Daoyuan Wang] add date in sql parser and java type conversion 024c9a6 [Daoyuan Wang] clean some import order d6715fc [Daoyuan Wang] refactoring Date as Primitive Int internally 374abd5 [Daoyuan Wang] spark native date type support
The previous #3732 is reverted due to some test failure. Have fixed that. Author: Daoyuan Wang <[email protected]> Closes #4325 from adrian-wang/datenative and squashes the following commits: 096e20d [Daoyuan Wang] fix for mixed timezone 0ed0fdc [Daoyuan Wang] fix test data a2fdd4e [Daoyuan Wang] getDate c37832b [Daoyuan Wang] row to catalyst f0005b1 [Daoyuan Wang] add date in sql parser and java type conversion 024c9a6 [Daoyuan Wang] clean some import order d6715fc [Daoyuan Wang] refactoring Date as Primitive Int internally 374abd5 [Daoyuan Wang] spark native date type support (cherry picked from commit db821ed) Signed-off-by: Michael Armbrust <[email protected]>
This PR might have some issues with apache#3732 , and this would have merge conflicts with apache#3820 so the review can be delayed till that 2 were merged. Author: Daoyuan Wang <[email protected]> Closes apache#3822 from adrian-wang/parquetdate and squashes the following commits: 2c5d54d [Daoyuan Wang] add a test case faef887 [Daoyuan Wang] parquet support for primitive date 97e9080 [Daoyuan Wang] parquet support for date type
This PR might have some issues with #3732 , and this would have merge conflicts with #3820 so the review can be delayed till that 2 were merged. Author: Daoyuan Wang <[email protected]> Closes #3822 from adrian-wang/parquetdate and squashes the following commits: 2c5d54d [Daoyuan Wang] add a test case faef887 [Daoyuan Wang] parquet support for primitive date 97e9080 [Daoyuan Wang] parquet support for date type (cherry picked from commit 4659468) Signed-off-by: Cheng Lian <[email protected]>
Store daysSinceEpoch as an Int value(4 bytes) to represent DateType, instead of using java.sql.Date(8 bytes as Long) in catalyst row. This ensures the same comparison behavior of Hive and Catalyst.
Subsumes #3381
I thinks there are already some tests in JavaSQLSuite, and for python it will not affect python's datetime class.