-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GLUTEN-8738][VL] Update GlutenSQLQueryTestSuite to exclude or overwr…
…ite failed queries for Spark3.5 (#8739)
- Loading branch information
Showing
91 changed files
with
26,558 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
183 changes: 183 additions & 0 deletions
183
gluten-ut/spark35/src/test/resources/backends-velox/sql-tests/inputs/array.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
-- test cases for array functions | ||
|
||
create temporary view data as select * from values | ||
("one", array(11, 12, 13), array(array(111, 112, 113), array(121, 122, 123))), | ||
("two", array(21, 22, 23), array(array(211, 212, 213), array(221, 222, 223))) | ||
as data(a, b, c); | ||
|
||
select * from data; | ||
|
||
-- index into array | ||
select a, b[0], b[0] + b[1] from data; | ||
|
||
-- index into array of arrays | ||
select a, c[0][0] + c[0][0 + 1] from data; | ||
|
||
|
||
create temporary view primitive_arrays as select * from values ( | ||
array(true), | ||
array(2Y, 1Y), | ||
array(2S, 1S), | ||
array(2, 1), | ||
array(2L, 1L), | ||
array(9223372036854775809, 9223372036854775808), | ||
array(2.0D, 1.0D), | ||
array(float(2.0), float(1.0)), | ||
array(date '2016-03-14', date '2016-03-13'), | ||
array(timestamp '2016-11-15 20:54:00.000', timestamp '2016-11-12 20:54:00.000') | ||
) as primitive_arrays( | ||
boolean_array, | ||
tinyint_array, | ||
smallint_array, | ||
int_array, | ||
bigint_array, | ||
decimal_array, | ||
double_array, | ||
float_array, | ||
date_array, | ||
timestamp_array | ||
); | ||
|
||
select * from primitive_arrays; | ||
|
||
-- array_contains on all primitive types: result should alternate between true and false | ||
select | ||
array_contains(boolean_array, true), array_contains(boolean_array, false), | ||
array_contains(tinyint_array, 2Y), array_contains(tinyint_array, 0Y), | ||
array_contains(smallint_array, 2S), array_contains(smallint_array, 0S), | ||
array_contains(int_array, 2), array_contains(int_array, 0), | ||
array_contains(bigint_array, 2L), array_contains(bigint_array, 0L), | ||
array_contains(decimal_array, 9223372036854775809), array_contains(decimal_array, 1), | ||
array_contains(double_array, 2.0D), array_contains(double_array, 0.0D), | ||
array_contains(float_array, float(2.0)), array_contains(float_array, float(0.0)), | ||
array_contains(date_array, date '2016-03-14'), array_contains(date_array, date '2016-01-01'), | ||
array_contains(timestamp_array, timestamp '2016-11-15 20:54:00.000'), array_contains(timestamp_array, timestamp '2016-01-01 20:54:00.000') | ||
from primitive_arrays; | ||
|
||
-- array_contains on nested arrays | ||
select array_contains(b, 11), array_contains(c, array(111, 112, 113)) from data; | ||
|
||
-- sort_array | ||
select | ||
sort_array(boolean_array), | ||
sort_array(tinyint_array), | ||
sort_array(smallint_array), | ||
sort_array(int_array), | ||
sort_array(bigint_array), | ||
sort_array(decimal_array), | ||
sort_array(double_array), | ||
sort_array(float_array), | ||
sort_array(date_array), | ||
sort_array(timestamp_array) | ||
from primitive_arrays; | ||
|
||
-- sort_array with an invalid string literal for the argument of sort order. | ||
select sort_array(array('b', 'd'), '1'); | ||
|
||
-- sort_array with an invalid null literal casted as boolean for the argument of sort order. | ||
select sort_array(array('b', 'd'), cast(NULL as boolean)); | ||
|
||
-- size | ||
select | ||
size(boolean_array), | ||
size(tinyint_array), | ||
size(smallint_array), | ||
size(int_array), | ||
size(bigint_array), | ||
size(decimal_array), | ||
size(double_array), | ||
size(float_array), | ||
size(date_array), | ||
size(timestamp_array) | ||
from primitive_arrays; | ||
|
||
-- index out of range for array elements | ||
select element_at(array(1, 2, 3), 5); | ||
select element_at(array(1, 2, 3), -5); | ||
select element_at(array(1, 2, 3), 0); | ||
|
||
select elt(4, '123', '456'); | ||
select elt(0, '123', '456'); | ||
select elt(-1, '123', '456'); | ||
select elt(null, '123', '456'); | ||
select elt(null, '123', null); | ||
select elt(1, '123', null); | ||
select elt(2, '123', null); | ||
|
||
select array(1, 2, 3)[5]; | ||
select array(1, 2, 3)[-1]; | ||
|
||
-- array_size | ||
select array_size(array()); | ||
select array_size(array(true)); | ||
select array_size(array(2, 1)); | ||
select array_size(NULL); | ||
select array_size(map('a', 1, 'b', 2)); | ||
|
||
-- size(arrays_zip) | ||
select size(arrays_zip(array(1, 2, 3), array(4), array(7, 8, 9, 10))); | ||
select size(arrays_zip(array(), array(1, 2, 3), array(4), array(7, 8, 9, 10))); | ||
select size(arrays_zip(array(1, 2, 3), array(4), null, array(7, 8, 9, 10))); | ||
|
||
-- isnotnull(arrays_zip) | ||
select isnotnull(arrays_zip(array(), array(4), array(7, 8, 9, 10))); | ||
select isnotnull(arrays_zip(array(1, 2, 3), array(4), array(7, 8, 9, 10))); | ||
select isnotnull(arrays_zip(array(1, 2, 3), NULL, array(4), array(7, 8, 9, 10))); | ||
|
||
-- function get() | ||
select get(array(1, 2, 3), 0); | ||
select get(array(1, 2, 3), 3); | ||
select get(array(1, 2, 3), null); | ||
select get(array(1, 2, 3), -1); | ||
|
||
-- function array_insert() | ||
select array_insert(array(1, 2, 3), 3, 4); | ||
select array_insert(array(2, 3, 4), 0, 1); | ||
select array_insert(array(2, 3, 4), 1, 1); | ||
select array_insert(array(1, 3, 4), -2, 2); | ||
select array_insert(array(1, 2, 3), 3, "4"); | ||
select array_insert(cast(NULL as ARRAY<INT>), 1, 1); | ||
select array_insert(array(1, 2, 3, NULL), cast(NULL as INT), 4); | ||
select array_insert(array(1, 2, 3, NULL), 4, cast(NULL as INT)); | ||
select array_insert(array(2, 3, NULL, 4), 5, 5); | ||
select array_insert(array(2, 3, NULL, 4), -5, 1); | ||
select array_insert(array(1), 2, cast(2 as tinyint)); | ||
|
||
set spark.sql.legacy.negativeIndexInArrayInsert=true; | ||
select array_insert(array(1, 3, 4), -2, 2); | ||
select array_insert(array(2, 3, NULL, 4), -5, 1); | ||
set spark.sql.legacy.negativeIndexInArrayInsert=false; | ||
|
||
-- function array_compact | ||
select array_compact(id) from values (1) as t(id); | ||
select array_compact(array("1", null, "2", null)); | ||
select array_compact(array("a", "b", "c")); | ||
select array_compact(array(1D, null, 2D, null)); | ||
select array_compact(array(array(1, 2, 3, null), null, array(4, null, 6))); | ||
select array_compact(array(null)); | ||
|
||
-- function array_append | ||
select array_append(array(1, 2, 3), 4); | ||
select array_append(array('a', 'b', 'c'), 'd'); | ||
select array_append(array(1, 2, 3, NULL), NULL); | ||
select array_append(array('a', 'b', 'c', NULL), NULL); | ||
select array_append(CAST(null AS ARRAY<String>), 'a'); | ||
select array_append(CAST(null AS ARRAY<String>), CAST(null as String)); | ||
select array_append(array(), 1); | ||
select array_append(CAST(array() AS ARRAY<String>), CAST(NULL AS String)); | ||
select array_append(array(CAST(NULL AS String)), CAST(NULL AS String)); | ||
|
||
-- function array_prepend | ||
select array_prepend(array(1, 2, 3), 4); | ||
select array_prepend(array('a', 'b', 'c'), 'd'); | ||
select array_prepend(array(1, 2, 3, NULL), NULL); | ||
select array_prepend(array('a', 'b', 'c', NULL), NULL); | ||
select array_prepend(CAST(null AS ARRAY<String>), 'a'); | ||
select array_prepend(CAST(null AS ARRAY<String>), CAST(null as String)); | ||
select array_prepend(array(), 1); | ||
select array_prepend(CAST(array() AS ARRAY<String>), CAST(NULL AS String)); | ||
select array_prepend(array(CAST(NULL AS String)), CAST(NULL AS String)); | ||
|
||
-- SPARK-45599: Confirm 0.0, -0.0, and NaN are handled appropriately. | ||
select array_union(array(0.0, -0.0, DOUBLE("NaN")), array(0.0, -0.0, DOUBLE("NaN"))); | ||
select array_distinct(array(0.0, -0.0, -0.0, DOUBLE("NaN"), DOUBLE("NaN"))); |
77 changes: 77 additions & 0 deletions
77
gluten-ut/spark35/src/test/resources/backends-velox/sql-tests/inputs/bitwise.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
-- test cases for bitwise functions | ||
|
||
-- null | ||
select bit_count(null); | ||
|
||
-- boolean | ||
select bit_count(true); | ||
select bit_count(false); | ||
|
||
-- byte/tinyint | ||
select bit_count(cast(1 as tinyint)); | ||
select bit_count(cast(2 as tinyint)); | ||
select bit_count(cast(3 as tinyint)); | ||
|
||
-- short/smallint | ||
select bit_count(1S); | ||
select bit_count(2S); | ||
select bit_count(3S); | ||
|
||
-- int | ||
select bit_count(1); | ||
select bit_count(2); | ||
select bit_count(3); | ||
|
||
-- long/bigint | ||
select bit_count(1L); | ||
select bit_count(2L); | ||
select bit_count(3L); | ||
|
||
-- negative num | ||
select bit_count(-1L); | ||
|
||
-- edge value | ||
select bit_count(9223372036854775807L); | ||
select bit_count(-9223372036854775808L); | ||
|
||
-- other illegal arguments | ||
select bit_count("bit count"); | ||
select bit_count('a'); | ||
|
||
-- test for bit_xor | ||
-- | ||
CREATE OR REPLACE TEMPORARY VIEW bitwise_test AS SELECT * FROM VALUES | ||
(1, 1, 1, 1L), | ||
(2, 3, 4, null), | ||
(7, 7, 7, 3L) AS bitwise_test(b1, b2, b3, b4); | ||
|
||
-- empty case | ||
SELECT BIT_XOR(b3) AS n1 FROM bitwise_test where 1 = 0; | ||
|
||
-- null case | ||
SELECT BIT_XOR(b4) AS n1 FROM bitwise_test where b4 is null; | ||
|
||
-- the suffix numbers show the expected answer | ||
SELECT | ||
BIT_XOR(cast(b1 as tinyint)) AS a4, | ||
BIT_XOR(cast(b2 as smallint)) AS b5, | ||
BIT_XOR(b3) AS c2, | ||
BIT_XOR(b4) AS d2, | ||
BIT_XOR(distinct b4) AS e2 | ||
FROM bitwise_test; | ||
|
||
-- group by | ||
SELECT bit_xor(b3) FROM bitwise_test GROUP BY b1 & 1; | ||
|
||
--having | ||
SELECT b1, bit_xor(b2) FROM bitwise_test GROUP BY b1 HAVING bit_and(b2) < 7; | ||
|
||
-- window | ||
SELECT b1, b2, bit_xor(b2) OVER (PARTITION BY b1 ORDER BY b2) FROM bitwise_test; | ||
|
||
-- getbit | ||
select getbit(11L, 3), getbit(11L, 2), getbit(11L, 1), getbit(11L, 0); | ||
select getbit(11L, 2 + 1), getbit(11L, 3 - 1), getbit(10L + 1, 1 * 1), getbit(cast(11L / 1 AS long), 1 - 1); | ||
select getbit(11L, 63); | ||
select getbit(11L, -1); | ||
select getbit(11L, 64); |
Oops, something went wrong.