-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21117][SQL] Built-in SQL Function Support - WIDTH_BUCKET #28764
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
sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Outdated
Show resolved
Hide resolved
|
Test build #123675 has finished for PR 28764 at commit
|
|
Test build #123673 has finished for PR 28764 at commit
|
|
retest this please |
|
Test build #123676 has finished for PR 28764 at commit
|
|
retest this please |
|
Test build #123694 has finished for PR 28764 at commit
|
|
Could you review this? @HyukjinKwon @viirya @wangyum @yaooqinn |
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
viirya
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.
Looks okay overall. cc @cloud-fan @dongjoon-hyun
|
Thank you for pinging me, @viirya . |
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
|
+1, LGTM (only minor comments). Thanks, @maropu . |
|
Thanks for your kind reviews, @dongjoon-hyun ! |
|
Test build #123808 has finished for PR 28764 at commit
|
|
retest this please |
|
Test build #123795 has finished for PR 28764 at commit
|
|
Test build #123823 has finished for PR 28764 at commit
|
|
retest this please |
|
Test build #123829 has finished for PR 28764 at commit
|
|
Thank you, @maropu and all. |
|
Thanks a lot, @dongjoon-hyun, @viirya, and @yaooqinn ! |
|
late LGTM! |
| | org.apache.spark.sql.catalyst.expressions.Uuid | uuid | SELECT uuid() | struct<uuid():string> | | ||
| | org.apache.spark.sql.catalyst.expressions.WeekDay | weekday | SELECT weekday('2009-07-30') | struct<weekday(CAST(2009-07-30 AS DATE)):int> | | ||
| | org.apache.spark.sql.catalyst.expressions.WeekOfYear | weekofyear | SELECT weekofyear('2008-02-20') | struct<weekofyear(CAST(2008-02-20 AS DATE)):int> | | ||
| | org.apache.spark.sql.catalyst.expressions.WidthBucket | width_bucket | SELECT width_bucket(5.3, 0.2, 10.6, 5) | struct<widthbucket(CAST(5.3 AS DOUBLE), CAST(0.2 AS DOUBLE), CAST(10.6 AS DOUBLE), CAST(5 AS BIGINT)):bigint> | |
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.
The output schema is widthbucket? It should be width_bucket if we define the prettyName to width_bucket?
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.
yea, it looks better. I'll fix it later.
| override def children: Seq[Expression] = Seq(value, minValue, maxValue, numBucket) | ||
| override def inputTypes: Seq[AbstractDataType] = Seq(DoubleType, DoubleType, DoubleType, LongType) | ||
| override def dataType: DataType = LongType | ||
| override def nullable: Boolean = true |
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.
override def prettyName: String = "width_bucket" ?
### What changes were proposed in this pull request? This PR is to define prettyName for `WidthBucket`. This comes from the gatorsmile's suggestion: #28764 (comment) ### Why are the changes needed? For a better name. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests. Closes #29183 from maropu/SPARK-21117-FOLLOWUP. Authored-by: Takeshi Yamamuro <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
What changes were proposed in this pull request?
This PR intends to add a build-in SQL function -
WIDTH_BUCKET.It is the rework of #18323.
Closes #18323
The other RDBMS references for
WIDTH_BUCKET:Why are the changes needed?
For better usability.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Added unit tests.