Uh oh!
There was an error while loading. Please reload this page.
[SPARK-36921][SQL] Support ANSI intervals by DIV - #34257
Conversation
Peng-Lei
commented
Oct 12, 2021
@MaxGekk Could you take a look? Thank you. I'm not quite sure if this PR will solve the SPARK-36921 |
MaxGekk
commented
Oct 12, 2021
ok to test |
SparkQA
commented
Oct 12, 2021
Kubernetes integration test starting |
SparkQA
commented
Oct 12, 2021
Kubernetes integration test status failure |
There was a problem hiding this comment.
Could you check negative intervals, and also some corner cases like division by max/min and zero intervals (ArithmeticExpressionSuite).
MaxGekk
left a comment
There was a problem hiding this comment.
LGTM in general, could you add an example to the expression description.
SparkQA
commented
Oct 12, 2021
Test build #144160 has finished for PR 34257 at commit
|
SparkQA
commented
Oct 13, 2021
Kubernetes integration test starting |
SparkQA
commented
Oct 13, 2021
Kubernetes integration test status failure |
DIVMaxGekk
commented
Oct 13, 2021
+1, LGTM. Merging to master. |
SparkQA
commented
Oct 13, 2021
Test build #144191 has finished for PR 34257 at commit
|
cloud-fan
commented
Oct 15, 2021
|
MaxGekk
commented
Oct 15, 2021
@cloud-fan The ANSI SQL standard doesn't define the semantic of DIV. We can implement it as we want.
For the consistency to existing Spark's DIV implementation for other input types. This is widest integer that doesn't overflow on div of day-time interval. |
MaxGekk
commented
Oct 15, 2021
Why DIV returns long is the question to you, @cloud-fan ;-) |
MaxGekk
commented
Oct 15, 2021
Following to our current approach for ANSI interval in other places, we should be more stronger here. @Peng-Lei Could you address this, please. |
What changes were proposed in this pull request?
Why are the changes needed?
Extended the div function to support ANSI intervals. The operation should produce quotient of division.
SPARK-36921
Does this PR introduce any user-facing change?
Yes, user can use user can use YearMonthIntervalType and DayTimeIntervalType as input for div function.
How was this patch tested?
Add ut testcase