[
https://issues.apache.org/jira/browse/CALCITE-3220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16897247#comment-16897247
]
Julian Hyde commented on CALCITE-3220:
--------------------------------------
Whoever reviews this should fix the title. Currently it says “hive dialect does
the right thing” which reads neither like a bug nor as a feature.
> HiveSqlDialect transform function trim to correct hive format
> -------------------------------------------------------------
>
> Key: CALCITE-3220
> URL: https://issues.apache.org/jira/browse/CALCITE-3220
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.19.0
> Reporter: Jacky Woo
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Let's assume sql = SELECT TRIM(' str ')
> When we use HiveSqlDialect and transform "sql", we expect SELECT TRIM(' str
> '),but get SELECT TRIM(BOTH ' ' FROM ' str ') which is incorrect sql format
> in hive.
> So maybe HiveSqlDialect behavior should be changed when transform function
> trim:
> # {{SELECT TRIM(' str ') => SELECT TRIM(' str ') }}
> # {{SELECT TRIM(BOTH ' ' from ' str ') => SELECT TRIM(' str ')}}
> # {{SELECT TRIM(LEADING ' ' from ' str ') => SELECT LTRIM(' str ')}}
> # {{SELECT TRIM(TRAILING ' ' from ' str ')=> SELECT RTRIM(' str ') }}
> {{This is the linked github pr #1342
> [https://github.com/apache/calcite/pull/1342]}}
>
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)