Skip to content

Commit b66971c

Browse files
committed
test: improve gcd edge case assertions
1 parent 622b705 commit b66971c

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

  • datafusion/sqllogictest/test_files

datafusion/sqllogictest/test_files/math.slt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,14 @@ SELECT gcd(arrow_cast(column1, 'Decimal256(40,0)'), arrow_cast(column2, 'Decimal
10631063
15
10641064

10651065
# gcd array with zero, minimum, and null scalars
1066+
query I
1067+
SELECT gcd(column1, 0) FROM (VALUES (1), (2), (0), (NULL));
1068+
----
1069+
1
1070+
2
1071+
0
1072+
NULL
1073+
10661074
query I
10671075
SELECT gcd(column1, -9223372036854775808) FROM (VALUES (1), (2), (NULL));
10681076
----
@@ -1078,13 +1086,13 @@ NULL
10781086
NULL
10791087

10801088
# invalid argument count and type
1081-
query error DataFusion error:
1089+
query error gcd function requires 2 arguments, got 0
10821090
SELECT gcd();
10831091

1084-
query error DataFusion error:
1092+
query error gcd function requires 2 arguments, got 3
10851093
SELECT gcd(1, 2, 3);
10861094

1087-
query error DataFusion error:
1095+
query error Unsupported argument types Utf8 and Utf8 for function gcd
10881096
SELECT gcd('x', 'y');
10891097

10901098

0 commit comments

Comments
 (0)