Github user thunterdb commented on a diff in the pull request:
https://github.com/apache/spark/pull/16971#discussion_r102592174
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/stat/StatFunctions.scala
---
@@ -78,7 +80,12 @@ object StatFunctions extends Logging {
def apply(summaries: Array[QuantileSummaries], row: Row):
Array[QuantileSummaries] = {
var i = 0
while (i < summaries.length) {
- summaries(i) = summaries(i).insert(row.getDouble(i))
+ if (!row.isNullAt(i)) {
--- End diff --
Thank you for fixing this issue, it was an oversight in my original
implementation.
The current exception being thrown depends on an implementation detail
(calling `sampled.head`). Can you modify the function `def query` below to
explicitly throw an exception if `sampled` is empty, and document this behavior
in that function? This way, we will not forget it if decide to change the
semantics of that class.
As @MLnick was mentioning above, it would be preferrable to either return
an Option, null or NaN eventually, but this can wait for more consensus.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]