Skip to content
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-30551][SQL] Disable comparison for interval type #27262

Closed
wants to merge 3 commits into from
Closed

[SPARK-30551][SQL] Disable comparison for interval type #27262

wants to merge 3 commits into from

Conversation

yaooqinn
Copy link
Member

@yaooqinn yaooqinn commented Jan 17, 2020

What changes were proposed in this pull request?

As we are not going to follow ANSI to implement year-month and day-time interval types, it is weird to compare the year-month part to the day-time part for our current implementation of interval type now.

Additionally, the current ordering logic comes from PostgreSQL where the implementation of the interval is messy. And we are not aiming PostgreSQL compliance at all.

THIS PR will revert #26681 and #26337

Why are the changes needed?

make interval type more future-proofing

Does this PR introduce any user-facing change?

there are new in 3.0, so no

How was this patch tested?

existing uts shall work

@@ -29,7 +29,7 @@
/**
* The internal representation of interval type.
*/
public final class CalendarInterval implements Serializable, Comparable<CalendarInterval> {
public final class CalendarInterval implements Serializable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a MAX_VALUE and MIN_VALUE in this file, shall we remove them as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, remove them too

protected var upper: CalendarInterval = CalendarInterval.MIN_VALUE
protected var lower: CalendarInterval = CalendarInterval.MAX_VALUE
protected var upper: CalendarInterval = null
protected var lower: CalendarInterval = null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we follow BinaryColumnStats and don't define the upper and lower variable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@cloud-fan
Copy link
Contributor

shall we also revert #26681 ?

@yaooqinn
Copy link
Member Author

shall we also revert #26681 ?

thanks, I missed this one

@SparkQA
Copy link

SparkQA commented Jan 17, 2020

Test build #116944 has finished for PR 27262 at commit 1d598ee.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jan 17, 2020

Test build #116937 has finished for PR 27262 at commit 7bb8962.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • public final class CalendarInterval implements Serializable

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please be clear for the reverting in the PR description, @yaooqinn .
If SPARK-30048 is clearly reverted by this PR, could you update SPARK-30048 JIRA, @cloud-fan ?

@dongjoon-hyun
Copy link
Member

Also, cc @maropu

@SparkQA
Copy link

SparkQA commented Jan 17, 2020

Test build #116954 has finished for PR 27262 at commit a44e157.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

I've updated SPARK-29679 and SPARK-30048 as won't do and mention they have been reverted.

Thanks, merging to master!

@dongjoon-hyun
Copy link
Member

Thank you for the clarification, @cloud-fan and @yaooqinn .

@maropu
Copy link
Member

maropu commented Jan 20, 2020

Checked; late LGTM.

cloud-fan pushed a commit that referenced this pull request Feb 22, 2021
…lity

### What changes were proposed in this pull request?
In the PR, I propose to revert #26659 partially regarding to comparability of interval values. The comment became incorrect after #27262.

### Why are the changes needed?
The comment is incorrect, and it might confuse Spark's devs/users.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
By checking scala coding style `./dev/scalastyle`.

Closes #31610 from MaxGekk/doc-interval-not-comparable.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
cloud-fan pushed a commit that referenced this pull request Feb 22, 2021
…lity

### What changes were proposed in this pull request?
In the PR, I propose to revert #26659 partially regarding to comparability of interval values. The comment became incorrect after #27262.

### Why are the changes needed?
The comment is incorrect, and it might confuse Spark's devs/users.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
By checking scala coding style `./dev/scalastyle`.

Closes #31610 from MaxGekk/doc-interval-not-comparable.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit 7df4fed)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
a0x8o added a commit to a0x8o/spark that referenced this pull request Feb 22, 2021
…lity

### What changes were proposed in this pull request?
In the PR, I propose to revert apache/spark#26659 partially regarding to comparability of interval values. The comment became incorrect after apache/spark#27262.

### Why are the changes needed?
The comment is incorrect, and it might confuse Spark's devs/users.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
By checking scala coding style `./dev/scalastyle`.

Closes #31610 from MaxGekk/doc-interval-not-comparable.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants