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/08/13 08:37:00 UTC
[jira] [Updated] (CALCITE-3220) wrong sql format when transforming
function SUBSTRING to hive sql
[ https://issues.apache.org/jira/browse/CALCITE-3220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jacky Woo updated CALCITE-3220:
-------------------------------
Summary: wrong sql format when transforming function SUBSTRING to hive sql (was: HiveSqlDialect transform function trim to correct hive format)
> wrong sql format when transforming function SUBSTRING to hive sql
> -----------------------------------------------------------------
>
> 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: 40m
> 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)