-
Notifications
You must be signed in to change notification settings - Fork 29k
[WIP][SPARK-7101][SQL] support java.sql.Time #28858
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
Conversation
|
Test build #124216 has finished for PR 28858 at commit
|
| @Stable | ||
| class TimeType private() extends AtomicType { | ||
| /** | ||
| * Internally, a timestamp is stored as the number of microseconds from |
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.
timestamp -> time?
|
|
||
| /** | ||
| * The companion case object and its class is separated so the companion object also subclasses | ||
| * the TimestampType class. Otherwise, the companion object would be of type "TimestampType$" |
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.
TimestampType -> TimeType?
TimestampType$ -> TimeType$?
| // January 1, 1970, 00:00:00 GMT for "9999-12-31 23:59:59.999999". | ||
| milliseconds = rand.nextLong() % 253402329599999L | ||
| } | ||
| // DateTimeUtils.toJavaTime takes microsecond. |
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.
takes microsecond? It seems that milliseconds is passed.
| .add("date", DateType) | ||
| .add("timestamp", TimestampType) | ||
| .add("udt", new ExamplePointUDT)) | ||
| // .add("null", NullType) |
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.
? Please revert this commenting out.
|
Hi, @younggyuchun . Could you resolve conflicts? |
|
@dongjoon-hyun |
# Conflicts: # sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala # sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala # sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala # sql/catalyst/src/test/scala/org/apache/spark/sql/RandomDataGenerator.scala # sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala # sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala
|
Test build #124223 has finished for PR 28858 at commit
|
MaxGekk
left a comment
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.
Please, take a look at #25678 and the reasons why I closed it.
| DateType, | ||
| TimestampType | ||
| TimestampType, | ||
| TimeType |
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.
Problem is that you have to define the mapping for PySpark and SparkR too that's probably one of the tricky part.
I think it's best to loop the dev mailing list and see if there's a big support for this. Otherwise, I'm not super supportive of it due to the maintenance cost.
|
Oh, right. This was tried by @MaxGekk before and concluded by the following comment by @rxin . In this case, we had better close this. Sorry about that, @younggyuchun . |
|
Gentle ping, @younggyuchun . |
|
@dongjoon-hyun Thank you for your comment. Don't be sorry there are tons of work :). |
|
Thanks. Yes. +1 for closing them with this and previous reference. |
|
I sent the SPIP https://issues.apache.org/jira/browse/SPARK-51162 to dev list for discussion (link). @younggyuchun @dongjoon-hyun @HyukjinKwon Please, leave comments in the thread if you are still interested in the feature. |
What changes were proposed in this pull request?
This PR aims to support java.sql.Time with an associated TimeType.
Why are the changes needed?
Several RDBMSes support the TIME data type. The TIME data type accepts time value; for example, 07:30:00.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Pass the Jenkins