-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-19436][SQL] Add missing tests for approxQuantile #16776
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
Changes from 1 commit
4d42cfd
f259543
5f456b2
cf0b808
9a8fc1e
4345709
2fbe21a
322141a
e5bac53
fa1069a
d3e3ee0
db23d11
7c54234
2268d36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,8 +71,12 @@ final class DataFrameStatFunctions private[sql](df: DataFrame) { | |
| col: String, | ||
| probabilities: Array[Double], | ||
| relativeError: Double): Array[Double] = { | ||
| StatFunctions.multipleApproxQuantiles(df.select(col).na.drop(), | ||
| Seq(col), probabilities, relativeError).head.toArray | ||
| val res = approxQuantile(Array(col), probabilities, relativeError) | ||
| if (res != null) { | ||
| res.head | ||
| } else { | ||
| null | ||
| } | ||
|
||
| } | ||
|
|
||
| /** | ||
|
|
@@ -96,8 +100,12 @@ final class DataFrameStatFunctions private[sql](df: DataFrame) { | |
| cols: Array[String], | ||
| probabilities: Array[Double], | ||
| relativeError: Double): Array[Array[Double]] = { | ||
| StatFunctions.multipleApproxQuantiles(df.select(cols.map(col): _*).na.drop(), cols, | ||
| probabilities, relativeError).map(_.toArray).toArray | ||
| try { | ||
| StatFunctions.multipleApproxQuantiles(df.select(cols.map(col): _*).na.drop(), cols, | ||
|
||
| probabilities, relativeError).map(_.toArray).toArray | ||
| } catch { | ||
| case e: NoSuchElementException => null | ||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
||
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 Scaladoc should describe this case