-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-16228][SQL] HiveSessionCatalog should return double-param functions for decimal param lookups
#13930
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-16228][SQL] HiveSessionCatalog should return double-param functions for decimal param lookups
#13930
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,6 +142,13 @@ class HiveUDFSuite extends QueryTest with TestHiveSingleton with SQLTestUtils { | |
| sql("SELECT array(max(key), max(key)) FROM src").collect().toSeq) | ||
| } | ||
|
|
||
| test("SPARK-16228 Percentile needs explicit cast to double") { | ||
| sql("select percentile(value, cast(0.5 as double)) from values 1,2,3 T(value)") | ||
| sql("select percentile_approx(value, cast(0.5 as double)) from values 1.0,2.0,3.0 T(value)") | ||
| sql("select percentile(value, 0.5) from values 1,2,3 T(value)") | ||
| sql("select percentile_approx(value, 0.5) from values 1.0,2.0,3.0 T(value)") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't cover all interfaces of still throws the seen error as outlined in https://issues.apache.org/jira/browse/SPARK-16228?focusedCommentId=15673869&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15673869 Should I report as bug? Thanks. |
||
| } | ||
|
|
||
| test("Generic UDAF aggregates") { | ||
| checkAnswer(sql("SELECT ceiling(percentile_approx(key, 0.99999D)) FROM src LIMIT 1"), | ||
| sql("SELECT max(key) FROM src LIMIT 1").collect().toSeq) | ||
|
|
||
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.
@dongjoon-hyun What is the reason that we need to
catchan exception instead of letting the analyzer do the job?