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

LIKE Operator with % does not match when column contains newline

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.12.0
    • core
    • None

    Description

      If I have a column where some rows contain a newline, then using a % does not match as it should. For example, if I have a column named 'foo' where a row contains 'My\nValue' then the following query I would expect to match:

      SELECT * FROM MyTable WHERE foo LIKE 'M%'

      However, this row is not returned by the above query. This appears to be a bug in the regex generated by the org.apache.calcite.runtime.Like class, as it generates '.*' for the %, but in Java the dot character does not match newlines unless it is compiled in dot-all mode.

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              markap14 Mark Payne
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: