-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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-1360] Add Timestamp Support for SQL #275
Conversation
Can one of the admins verify this patch? |
Sorry, some bugs in the unit test, I will look at those. |
@@ -17,6 +17,9 @@ | |||
|
|||
package org.apache.spark.sql.catalyst.expressions | |||
|
|||
import java.sql.Timestamp | |||
import java.lang.{NumberFormatException => NFE} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not shorten this? I am not sure if NFE is very obvious to readers
Overall, I think this looks pretty good. After you figure out the failing tests, you should also whitelist a bunch of tests that were only failing because we didn't have timestamp support. I got the list below by running
|
BTW, the whitelist has been reordered (via sort command of linux shell) after adding more passed cases, and actually more cases would be added like decimal_2 / decimal_3, however, the precision part of decimal still couldn't be exactly match, leave it for further improvement. |
|
||
override def apply(input: Row): Any = { | ||
val evaluated = child.apply(input) | ||
if (evaluated == null) { | ||
null | ||
} else { | ||
castingFunction(evaluated) | ||
if(child.dataType == dataType) evaluated else cast(evaluated) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should already be a rule that eliminates casts that don't do anything, so I think this check is unnecessary.
This is looking pretty good! A few small comments:
|
Jenkins, test this please. |
Merged build triggered. |
Merged build started. |
Merged build finished. |
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/13653/ |
Jenkins, test this please. |
1 similar comment
Jenkins, test this please. |
sorry, wait a minute, I am updating the golden files. |
Merged build triggered. |
Merged build started. |
Merged build finished. |
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/13665/ |
Can you start a new test please? |
Jenkins, retest this please, |
Merged build triggered. |
Merged build started. |
Merged build finished. All automated tests passed. |
All automated tests passed. |
@chenghao-intel three final things and then we can merge this! It needs to be rebased as I don't think it merges cleanly anymore (I also fixed the missing datatypes in ScalaReflection). I also added a test case for this code. Please add Timestamp to that. Finally, can you roll back all the spurious changes to the machine dependent golden files? You only need to add the ones that are new. This should do it:
Thanks! |
thank you @marmbrus, I've done the final things, I think it's ready to be merged. |
Jenkins, test this please. |
Jenkins, retest this please |
This LGTM as soon as we can get Jenkins to agree. |
Jenkins, retest this please |
Merged build triggered. |
Merged build started. |
merged. thanks! |
Merged build finished. All automated tests passed. |
All automated tests passed. |
This PR includes: 1) Add new data type Timestamp 2) Add more data type casting base on Hive's Rule 3) Fix bug missing data type in both parsers (HiveQl & SQLParser). Author: Cheng Hao <[email protected]> Closes apache#275 from chenghao-intel/timestamp and squashes the following commits: df709e5 [Cheng Hao] Move orc_ends_with_nulls to blacklist 24b04b0 [Cheng Hao] Put 3 cases into the black lists(describe_pretty,describe_syntax,lateral_view_outer) fc512c2 [Cheng Hao] remove the unnecessary data type equality check in data casting d0d1919 [Cheng Hao] Add more data type for scala reflection 3259808 [Cheng Hao] Add the new Golden files 3823b97 [Cheng Hao] Update the UnitTest cases & add timestamp type for HiveQL 54a0489 [Cheng Hao] fix bug mapping to 0 (which is supposed to be null) when NumberFormatException occurs 9cb505c [Cheng Hao] Fix issues according to PR comments e529168 [Cheng Hao] Fix bug of converting from String 6fc8100 [Cheng Hao] Update Unit Test & CodeStyle 8a1d4d6 [Cheng Hao] Add DataType for SqlParser ce4385e [Cheng Hao] Add TimestampType Support
* upgrades * Update deps list
* [SPARK-658] Updated the "Custom Installation" section of the "Install and Customize" doc page. * Fixed typo in "Limitations" doc ("use" => "user")
This PR includes: