kazuyukitanimura commented on code in PR #7025: URL: https://github.com/apache/datafusion-comet/pull/7025#discussion_r4317054116
########## spark/src/test/resources/sql-tests/expressions/array/array_append_eager_eval.sql: ########## @@ -0,0 +1,117 @@ +-- 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. + +-- ArrayAppend is RuntimeReplaceable from Spark 4.0, so CometArrayAppend is only reachable here. +-- MaxSparkVersion: 3.5 + +-- Spark's generated code for array_append evaluates the item on every row and guards only the +-- assignment of the result, so an item that raises under ANSI raises on a row whose array is NULL +-- as well. https://github.com/apache/datafusion-comet/issues/6086 +-- Config: spark.sql.ansi.enabled=true + +statement +CREATE TABLE array_append_eager(_1 INT) USING parquet + +statement +INSERT INTO array_append_eager VALUES (0), (1), (2), (3) + +-- Control: the ANSI divide raises on its own, so the query below is not vacuous +query expect_error(DIVIDE_BY_ZERO) +SELECT _1, 1 / (_1 - 1) AS d FROM array_append_eager + +-- At _1 = 1 the array is NULL and the item divides by zero +query expect_error(DIVIDE_BY_ZERO) Review Comment: updated -- 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]
