You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Dhirenda Gautam (Jira)" <ji...@apache.org> on 2020/01/02 07:55:00 UTC

[jira] [Updated] (CALCITE-3663) Support for TRIM function in Bigquery dialect

     [ https://issues.apache.org/jira/browse/CALCITE-3663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dhirenda Gautam updated CALCITE-3663:
-------------------------------------
    Description: 
In current Calcite implementation for query : SELECT TRIM('ABC') for  big-query Dialect it translated into SELECT TRIM(BOTH ' ' FROM 'ABC') .
But the appropriate query for BigQuery is :: SELECT TRIM('ABC')
Similarly below query
SELECT TRIM(BOTH 'a' from 'ABC') 
SELECT TRIM(LEADING ' ' from 'ABC') 
SELECT TRIM(TRAILING ' ' from 'ABC') are translated into invalid BigQuery query.

Unparse logic for the trim has been handle in BigQuery dialect to convert the source Trim query into valid bigQuery query.

  was:
When we run query SELECT TRIM('ABC') for  big-query Dialect
we expect SELECT TRIM('ABC'),but get SELECT TRIM(BOTH ' ' FROM 'ABC') which is not a valid query in Big-Query.

Similary below query

SELECT TRIM(BOTH 'a' from 'ABC') 
SELECT TRIM(LEADING ' ' from 'ABC') 
SELECT TRIM(TRAILING ' ' from 'ABC') are not getting converted into validate Query format.

Unparse logic for the trim has been handle in Big-query dialect to convert the source Trim query into valid big-query query.


> Support for TRIM function in Bigquery dialect
> ---------------------------------------------
>
>                 Key: CALCITE-3663
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3663
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Dhirenda Gautam
>            Priority: Major
>
> In current Calcite implementation for query : SELECT TRIM('ABC') for  big-query Dialect it translated into SELECT TRIM(BOTH ' ' FROM 'ABC') .
> But the appropriate query for BigQuery is :: SELECT TRIM('ABC')
> Similarly below query
> SELECT TRIM(BOTH 'a' from 'ABC') 
> SELECT TRIM(LEADING ' ' from 'ABC') 
> SELECT TRIM(TRAILING ' ' from 'ABC') are translated into invalid BigQuery query.
> Unparse logic for the trim has been handle in BigQuery dialect to convert the source Trim query into valid bigQuery query.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)