Skip to content

Commit 224f5e7

Browse files
committed
test: improve rpad assertions
1 parent fdf3541 commit 224f5e7

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

datafusion/sqllogictest/test_files/string/string_literal.slt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,9 @@ true 5
667667
# rpad with string, length, and fill arrays in every string width
668668
query BBB
669669
SELECT
670-
rpad(arrow_cast(column1, 'Utf8'), column2, arrow_cast(column3, 'Utf8')) = column4,
671-
rpad(arrow_cast(column1, 'LargeUtf8'), column2, arrow_cast(column3, 'LargeUtf8')) = column4,
672-
rpad(arrow_cast(column1, 'Utf8View'), column2, arrow_cast(column3, 'Utf8View')) = column4
670+
rpad(arrow_cast(column1, 'Utf8'), column2, arrow_cast(column3, 'Utf8')) IS NOT DISTINCT FROM column4,
671+
rpad(arrow_cast(column1, 'LargeUtf8'), column2, arrow_cast(column3, 'LargeUtf8')) IS NOT DISTINCT FROM column4,
672+
rpad(arrow_cast(column1, 'Utf8View'), column2, arrow_cast(column3, 'Utf8View')) IS NOT DISTINCT FROM column4
673673
FROM (VALUES
674674
('hi', 5, 'xy', 'hixyx'),
675675
('abcdef', 3, 'z', 'abc'),
@@ -684,21 +684,21 @@ true true true
684684
true true true
685685
true true true
686686
true true true
687-
NULL NULL NULL
688-
NULL NULL NULL
689-
NULL NULL NULL
687+
true true true
688+
true true true
689+
true true true
690690

691691
# rpad array path with the default fill
692692
query BBB
693693
SELECT
694-
rpad(arrow_cast(column1, 'Utf8'), column2) = column3,
695-
rpad(arrow_cast(column1, 'LargeUtf8'), column2) = column3,
696-
rpad(arrow_cast(column1, 'Utf8View'), column2) = column3
694+
rpad(arrow_cast(column1, 'Utf8'), column2) IS NOT DISTINCT FROM column3,
695+
rpad(arrow_cast(column1, 'LargeUtf8'), column2) IS NOT DISTINCT FROM column3,
696+
rpad(arrow_cast(column1, 'Utf8View'), column2) IS NOT DISTINCT FROM column3
697697
FROM (VALUES ('hi', 5, 'hi '), ('abcdef', 3, 'abc'), (NULL, 5, NULL)) AS t(column1, column2, column3);
698698
----
699699
true true true
700700
true true true
701-
NULL NULL NULL
701+
true true true
702702

703703
# a large scalar target length skips the scalar fast path
704704
query I
@@ -707,16 +707,16 @@ SELECT character_length(rpad('x', 16385, 'a'));
707707
16385
708708

709709
# invalid argument count/type and excessive target length
710-
query error DataFusion error:
710+
query error 'rpad' does not support zero arguments
711711
SELECT rpad();
712712

713-
query error DataFusion error:
713+
query error No function matches the given name and argument types 'rpad\(Utf8\)'
714714
SELECT rpad('x');
715715

716-
query error DataFusion error:
716+
query error No function matches the given name and argument types 'rpad\(Utf8, Int64, Utf8, Utf8\)'
717717
SELECT rpad('x', 2, 'y', 'z');
718718

719-
query error DataFusion error:
719+
query error No function matches the given name and argument types 'rpad\(Utf8, Utf8\)'
720720
SELECT rpad('x', 'bad');
721721

722722
query error rpad requested length 2147483648 too large

0 commit comments

Comments
 (0)