Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-4704

String operations yield incorrect results when executed through SQL shell

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • None
    • 2.8.0
    • dsl-sql
    • None

    Description

      TRIM is defined to trim all the characters in the first string from the string-to-be-trimmed. Calcite has an incorrect implementation of this. We use our own fixed implementation. But when executed through the SQL shell, the results do not match what we get from the PTransform path. Here two test cases that pass on master but are incorrect in the shell:

      BeamSQL> select TRIM(LEADING 'eh' FROM 'hehe__hehe');
      +------------+
      | EXPR$0 |
      +------------+
      | hehe__hehe |
      +------------+
      
      BeamSQL> select TRIM(TRAILING 'eh' FROM 'hehe__hehe');
      +------------+
      |   EXPR$0   |
      +------------+
      | hehe__heh  |
      +------------+
      
      BeamSQL> select TRIM(BOTH 'eh' FROM 'hehe__hehe');
      +------------+
      |   EXPR$0   |
      +------------+
      | hehe__heh  |
      +------------+
      

      Attachments

        Issue Links

          Activity

            People

              apilloud Andrew Pilloud
              kenn Kenneth Knowles
              Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 1h
                  1h