erenavsarogullari commented on code in PR #20420: URL: https://github.com/apache/datafusion/pull/20420#discussion_r2834311221
########## datafusion/sqllogictest/test_files/spark/array/shuffle.slt: ########## @@ -87,6 +87,26 @@ SELECT shuffle(column1, 1) FROM test_shuffle_fixed_size; [9, NULL, 8] NULL +query ? +SELECT shuffle(['2001-09-28T01:00:00'::timestamp, '2001-08-28T01:00:00'::timestamp, '2001-07-28T01:00:00'::timestamp, '2001-06-28T01:00:00'::timestamp, '2001-05-28T01:00:00'::timestamp], 1); Review Comment: In general, shuffle function is `non-deterministic`. However, it can also return `deterministic` result by passing `seed` for specially this kind of cases. For reference: - Spark Shuffle function accepts `optional randomSeed` argument to : https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala#L1264 - On the other hand, current DF-Spark Shuffle func implementation support following both cases by accepting both arguments for the alignment with Spark: ``` shuffle(array) shuffle(array, seed) ``` -- 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]
