getChan commented on code in PR #13966:
URL: https://github.com/apache/datafusion/pull/13966#discussion_r1900393942


##########
datafusion/sqllogictest/test_files/array.slt:
##########
@@ -5674,6 +5674,13 @@ select array_distinct([sum(a)]) from t1 where a > 100 
group by b;
 statement ok
 drop table t1;
 
+query ?
+select array_distinct(a) from values ([1, 2, 3]), (null), ([1, 3, 1]) as X(a);
+----
+[1, 2, 3]
+NULL
+[1, 3]

Review Comment:
   Does this mean that `datafusion-cli -c select array_distinct(null);` should 
also succeed? 
   It seems that `array_distinct` only accepts arguments of array type.
   ```
   DataFusion CLI v44.0.0
   Error: Error during planning: Error during planning: Failed to coerce 
arguments to satisfy a call to array_distinct function: coercion from [Null] to 
the signature ArraySignature(Array) failed. No function matches the given name 
and argument types 'array_distinct(Null)'. You might need to add explicit type 
casts.
           Candidate functions:
           array_distinct(array)
   ```
   ref.
   
https://github.com/apache/datafusion/blob/aafec07e086463fc7ed72c704e9f7e367460618a/datafusion/functions-nested/src/set_ops.rs#L251



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to