comphead commented on code in PR #4744: URL: https://github.com/apache/datafusion-comet/pull/4744#discussion_r3537358602
########## spark/src/test/resources/sql-tests/expressions/array/array_filter_fallback.sql: ########## @@ -0,0 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +-- Config: spark.comet.exec.scalaUDF.codegen.enabled=false + +query expect_fallback(The array_filter function in DataFusion is limited to one lambda parameter) +SELECT filter(array(1, 2), (x, i) -> i > 0) Review Comment: we may want to extend it in DF ########## spark/src/test/resources/sql-tests/expressions/array/array_filter.sql: ########## @@ -16,16 +16,22 @@ -- under the License. statement -CREATE TABLE test_array_filter(arr array<int>) USING parquet +CREATE TABLE test_array_filter(arr array<int>, threshold int) USING parquet statement -INSERT INTO test_array_filter VALUES (array(1, 2, 3, 4, 5)), (array(-1, 0, 1)), (array(10)), (NULL) +INSERT INTO test_array_filter VALUES (array(1, 2, 3, 4, 5), 10), (array(-1, 0, 1, NULL), 10), (array(NULL, NULL), 10), (array(10), 10), (NULL, 10), (array(), 10) query SELECT filter(arr, x -> x > 2) FROM test_array_filter query SELECT filter(arr, x -> x >= 0) FROM test_array_filter +query +SELECT filter(filter(arr, x -> x < threshold), y -> y > 0) FROM test_array_filter + +query +SELECT filter(filter(arr, x -> x < threshold), y -> y > 0) FROM test_array_filter + query SELECT filter(arr, (x, i) -> i > 0) FROM test_array_filter Review Comment: this tests passes but similar one should fallback in fallback file? 🤔 -- 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]
