rich7420 commented on code in PR #5798: URL: https://github.com/apache/datafusion-comet/pull/5798#discussion_r3976801600
########## spark/src/test/resources/sql-tests/expressions/array/get_array_item_ansi.sql: ########## @@ -25,34 +25,36 @@ -- ============================================================================ statement -CREATE TABLE ansi_array_oob(arr array<int>) USING parquet +CREATE TABLE ansi_array_oob(arr array<int>, positive_idx int, negative_idx int) USING parquet statement -INSERT INTO ansi_array_oob VALUES (array(1, 2, 3)) +INSERT INTO ansi_array_oob VALUES (array(1, 2, 3), 5, -1) + +-- Valid boundary indices must run natively as well as match Spark. +query +SELECT arr[0], arr[2] FROM ansi_array_oob -- ============================================================================ -- Array index out of bounds (positive index) --- Spark throws: [INVALID_ARRAY_INDEX] The index X is out of bounds --- Comet throws: Index out of bounds for array --- See https://github.com/apache/datafusion-comet/issues/3375 +-- Spark and Comet throw INVALID_ARRAY_INDEX in ANSI mode. -- ============================================================================ -- index beyond array length should throw (0-based indexing) -query ignore(https://github.com/apache/datafusion-comet/issues/3375) +query expect_error(INVALID_ARRAY_INDEX) Review Comment: Nice catch! thanks for that -- 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]
