You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jacky Woo (JIRA)" <ji...@apache.org> on 2019/07/31 07:53:00 UTC

[jira] [Created] (CALCITE-3220) HiveSqlDialect transform function trim to correct hive format

Jacky Woo created CALCITE-3220:
----------------------------------

             Summary: 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


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}}

 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)