Dhirenda Gautam created CALCITE-3771:
----------------------------------------

             Summary: Support of TRIM function for SPARK dialect and 
improvement in HIVE Dialect
                 Key: CALCITE-3771
                 URL: https://issues.apache.org/jira/browse/CALCITE-3771
             Project: Calcite
          Issue Type: Improvement
          Components: core
            Reporter: Dhirenda Gautam


In current Calcite implementation for query : SELECT TRIM('ABC') for SPARK 
Dialect it gets translated into SELECT TRIM(BOTH ' ' FROM 'ABC') .

But the proper query for SPARK is :: SELECT TRIM('ABC')

Unparse logic for the trim has been handled in Spark dialect to convert the 
source Trim query into valid SPARK query.

 

Also,In HIVE/SPARK dialect TRIM with two operand is not supported

Eg: SELECT TRIM(BOTH 'a' from 'ABC') So its equivalent is REGEXP_REPLACE which 
is handle in unparseTrim function.



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

Reply via email to