Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.39.0
Description
sql not support as follow:
presto> SELECT TRIM(LEADING 'a' from 'abcd'); Query 20250504_062451_29862_cqcdm failed: line 1:25: mismatched input 'from'. Expecting: ',', <expression> SELECT TRIM(TRAILING 'a' from 'abcd') Query 20250504_062451_29863_cqcdm failed: line 1:25: mismatched input 'from'. Expecting: ',', <expression> SELECT TRIM(BOTH 'a' from 'abcd') Query 20250504_062451_29863_cqcdm failed: line 1:25: mismatched input 'from'. Expecting: ',', <expression>
so need convert to:
presto> SELECT TRIM('abcd', 'a'); > bcd presto> SELECT LTRIM('abcd', 'a'); > bcd presto> SELECT RTRIM('abcd', 'd'); > abc presto> SELECT TRIM(' abcd '); > abcd
we can also refer to doc https://prestodb.io/docs/current/functions/string.html by search trim/ltrim/rtrim functions
so we need to fix it by unparse trim correctly.
Attachments
Issue Links
- links to