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

String operations yield incorrect results when executed through SQL shell

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: dsl-sql
    • Labels:
      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

              • Assignee:
                Unassigned
                Reporter:
                kenn Kenneth Knowles
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

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