-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-31818][SQL] Fix pushing down filters with java.time.Instant values in ORC
#28636
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
|
@cloud-fan @HyukjinKwon @dongjoon-hyun Please, review this PR. It is similar to #28261 but for timestamps. |
| implicit def bigDecimalToLiteral(d: java.math.BigDecimal): Literal = Literal(d) | ||
| implicit def decimalToLiteral(d: Decimal): Literal = Literal(d) | ||
| implicit def timestampToLiteral(t: Timestamp): Literal = Literal(t) | ||
| implicit def timestampToLiteral(t: Instant): Literal = Literal(t) |
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.
shall we call it instantToLiteral, to be consistent with localDateToLiteral?
|
Test build #123084 has finished for PR 28636 at commit
|
java.time.Instant values in ORCjava.time.Instant values in ORC
|
jenkins, retest this, please |
dongjoon-hyun
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.
+1, LGTM. Thank you for testing both hive profile, @MaxGekk .
|
Test build #123086 has finished for PR 28636 at commit
|
| implicit def bigDecimalToLiteral(d: java.math.BigDecimal): Literal = Literal(d) | ||
| implicit def decimalToLiteral(d: Decimal): Literal = Literal(d) | ||
| implicit def timestampToLiteral(t: Timestamp): Literal = Literal(t) | ||
| implicit def instantToLiteral(t: Instant): Literal = Literal(t) |
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.
variable name: i instead of t if want follow convention around
|
Test build #123093 has finished for PR 28636 at commit
|
|
Test build #123098 has finished for PR 28636 at commit
|
…values in ORC ### What changes were proposed in this pull request? Convert `java.time.Instant` to `java.sql.Timestamp` in pushed down filters to ORC datasource when Java 8 time API enabled. ### Why are the changes needed? The changes fix the exception raised while pushing date filters when `spark.sql.datetime.java8API.enabled` is set to `true`: ``` java.lang.IllegalArgumentException: Wrong value class java.time.Instant for TIMESTAMP.EQUALS leaf at org.apache.hadoop.hive.ql.io.sarg.SearchArgumentImpl$PredicateLeafImpl.checkLiteralType(SearchArgumentImpl.java:192) at org.apache.hadoop.hive.ql.io.sarg.SearchArgumentImpl$PredicateLeafImpl.<init>(SearchArgumentImpl.java:75) ``` ### Does this PR introduce any user-facing change? Yes ### How was this patch tested? Added tests to `OrcFilterSuite`. Closes #28636 from MaxGekk/orc-timestamp-filter-pushdown. Authored-by: Max Gekk <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 6c80ebb) Signed-off-by: Dongjoon Hyun <[email protected]>
|
Merged to master/3.0. Thank you, @MaxGekk , @cloud-fan , @seanli-rallyhealth . |
What changes were proposed in this pull request?
Convert
java.time.Instanttojava.sql.Timestampin pushed down filters to ORC datasource when Java 8 time API enabled.Why are the changes needed?
The changes fix the exception raised while pushing date filters when
spark.sql.datetime.java8API.enabledis set totrue:Does this PR introduce any user-facing change?
Yes
How was this patch tested?
Added tests to
OrcFilterSuite.