Description
Most SQL implementations trim all characters if more then one is provided to the trim function. Calcite's SqlFunctions implementation silently drops the extra characters, resulting in data corruption.
Here is a sampling of implementations that trim all characters:
MySQL - https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_trim
Sql Server - https://docs.microsoft.com/en-us/sql/t-sql/functions/trim-transact-sql?view=sql-server-2017
Flink - https://ci.apache.org/projects/flink/flink-docs-stable/dev/table/sql.html
Spark - https://spark.apache.org/docs/2.3.0/api/sql/index.html#trim
Postgres - https://www.postgresql.org/docs/9.1/static/functions-string.html
SqLite - https://www.sqlite.org/lang_corefunc.html#trim
Also see: CALCITE-2530 BEAM-4704
Attachments
Issue Links
- is related to
-
CALCITE-5887 Trim function can’t work well with SqlDelegatingConformance
- Open