array_repeat is marked as Incompatible in Comet, but the specific incompatibility is not documented. This issue tracks documenting and potentially fixing the behavior difference.
According to Spark's array_repeat behavior:
count timesExamples:
SELECT array_repeat('hello', 3);
-- Spark returns: ["hello", "hello", "hello"]
SELECT array_repeat('test', 0);
-- Spark returns: []
SELECT array_repeat('item', -1);
-- Spark returns: [] (negative count treated as 0)
SELECT array_repeat('test', null);
-- Spark returns: null
Comet uses DataFusion's array_repeat function. The specific behavior for negative counts may differ:
The test suite includes:
checkSparkAnswerAndOperator(sql("SELECT array_repeat(_4, 0) from t1"))
But negative count tests are not visible in the current test file.
array_repeat(x, -1) in both Spark and CometGREATEST(count, 0) to treat negative as 0Note: This issue was generated with AI assistance.