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

Preserving CAST of VARCHAR operand in binary comparison for BigQuery

    XMLWordPrintableJSON

Details

    Description

      We have a REL which has this information
      select * from employee where employee_id = cast('12' as float);

      but Calcite removes the CAST from the STRING literal('12' in our case). 
      select * from employee where employee_id = '12';

      There are dialects which needs explicit casting in the above case and we need to maintain the CAST in our dialect.

      Calcite removes the cast in SqlImplementor's stripCastFromString() method.

      I'm thinking of having the dialect intercept this and decide whether or not to remove the cast.

       

      I have created a PR https://github.com/apache/calcite/pull/1437

      Attachments

        Issue Links

          Activity

            People

              danny0405 Danny Chen
              Soma.Mondal Soma Mondal
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 6.5h
                  6.5h