Skip to content

Commit

Permalink
add tests covering ltrim and rtrim functioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Kev1n8 committed Aug 13, 2024
1 parent 08dc029 commit ae90c19
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions datafusion/sqllogictest/test_files/string_view.slt
Original file line number Diff line number Diff line change
Expand Up @@ -639,18 +639,19 @@ logical_plan
02)--TableScan: test projection=[column1_utf8view]

# Test LTRIM outputs
query TTTT
query TTTTT
SELECT
LTRIM(column1_utf8view, 'foo') AS l1,
LTRIM(column1_utf8view, column2_utf8view) AS l2,
LTRIM(column1_utf8view) AS l3,
LTRIM(column1_utf8view, NULL) AS l4
LTRIM(column1_utf8view, NULL) AS l4,
LTRIM(column1_utf8view, 'Xiang') AS l5
FROM test;
----
Andrew Andrew Andrew NULL
Xiangpeng (empty) Xiangpeng NULL
Raphael aphael Raphael NULL
NULL NULL NULL NULL
Andrew Andrew Andrew NULL Andrew
Xiangpeng (empty) Xiangpeng NULL peng
Raphael aphael Raphael NULL Raphael
NULL NULL NULL NULL NULL

## ensure no casts for RTRIM
# Test RTRIM with Utf8View input
Expand Down Expand Up @@ -684,18 +685,19 @@ logical_plan
02)--TableScan: test projection=[column1_utf8view]

# Test RTRIM outputs
query TTTT
query TTTTT
SELECT
RTRIM(column1_utf8view, 'foo') AS l1,
RTRIM(column1_utf8view, column2_utf8view) AS l2,
RTRIM(column1_utf8view) AS l3,
RTRIM(column1_utf8view, NULL) AS l4
RTRIM(column1_utf8view, NULL) AS l4,
RTRIM(column1_utf8view, 'peng') As l5
FROM test;
----
Andrew Andrew Andrew NULL
Xiangpeng (empty) Xiangpeng NULL
Raphael Raphael Raphael NULL
NULL NULL NULL NULL
Andrew Andrew Andrew NULL Andrew
Xiangpeng (empty) Xiangpeng NULL Xia
Raphael Raphael Raphael NULL Raphael
NULL NULL NULL NULL NULL


## Ensure no casts for CHARACTER_LENGTH
Expand Down

0 comments on commit ae90c19

Please sign in to comment.