You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Andrew Pilloud (JIRA)" <ji...@apache.org> on 2018/09/19 18:10:00 UTC

[jira] [Commented] (CALCITE-2571) TRIM does not match the behavior of most SQL implementations

    [ https://issues.apache.org/jira/browse/CALCITE-2571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16620983#comment-16620983 ] 

Andrew Pilloud commented on CALCITE-2571:
-----------------------------------------

Proposed fix: https://github.com/apache/calcite/pull/840

> TRIM does not match the behavior of most SQL implementations
> ------------------------------------------------------------
>
>                 Key: CALCITE-2571
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2571
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Andrew Pilloud
>            Assignee: Julian Hyde
>            Priority: Major
>
> 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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)