Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3771

Support of TRIM function for SPARK dialect and improvement in HIVE Dialect

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.22.0
    • Component/s: core

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                danny0405 Danny Chen
                Reporter:
                dhirenda.gautam Dhirenda Gautam
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h