[ https://issues.apache.org/jira/browse/CALCITE-3247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16915473#comment-16915473 ]
Jacky Woo edited comment on CALCITE-3247 at 8/29/19 2:30 AM: ------------------------------------------------------------- Hi Julian, It has been done. was (Author: jackywoo): Hi Julia, It has been done. > In JDBC adapter, when generating SQL for Hive, transform SUBSTRING function > to correct format > --------------------------------------------------------------------------------------------- > > Key: CALCITE-3247 > URL: https://issues.apache.org/jira/browse/CALCITE-3247 > Project: Calcite > Issue Type: Bug > Components: core > Affects Versions: 1.19.0 > Reporter: Jacky Woo > Priority: Minor > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > > Let's assume sql = SELECT SUBSTRING('ABC', 2) > When we use HiveSqlDialect and transform "sql", we expect SUBSTRING(' abc', > 2),but get SUBSTRING(' abc' FROM 2) which is incorrect sql format in hive. > So maybe HiveSqlDialect behavior should be changed when transform function > SUBSTRING: > # {{SELECT SUBSTRING('ABC', 2) => SELECT SUBSTRING('ABC', 2)}} > # {{SELECT SUBSTRING('ABC', 2, 3) => SELECT SUBSTRING('ABC', 2, 3) }} > # {{SELECT SUBSTRING('ABC' FROM 2) => SELECT SUBSTRING('ABC', 2) }} > # {{SELECT SUBSTRING('ABC' FROM 2 FOR 3) => SELECT SUBSTRING('ABC', 2, 3) }} > -- This message was sent by Atlassian Jira (v8.3.2#803003)