sesteves commented on code in PR #19941: URL: https://github.com/apache/datafusion/pull/19941#discussion_r2732736969
########## datafusion/sqllogictest/test_files/aggregate.slt: ########## @@ -2029,11 +2029,12 @@ statement ok INSERT INTO t1 VALUES (TRUE); # ISSUE: https://github.com/apache/datafusion/issues/12716 -# This test verifies that approx_percentile_cont_with_weight does not panic when given 'NaN' and returns 'inf' +# This test verifies that approx_percentile_cont_with_weight does not panic when given 'NaN' +# With weight=0, the data point does not contribute, so result is NULL query R SELECT approx_percentile_cont_with_weight(0, 0) WITHIN GROUP (ORDER BY 'NaN'::DOUBLE) FROM t1 WHERE t1.v1; ---- -Infinity +NULL Review Comment: With weight=0 and NaN value, both systems would effectively have no data (weight=0 means no contribution in both). ClickHouse would return NaN (for a Float64 result) while DataFusion returns NULL. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
