Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-17647

SQL LIKE does not handle backslashes correctly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.1, 2.2.0
    • Component/s: SQL
    • Labels:

      Description

      Try the following in SQL shell:

      select '\\\\' like '%\\%';
      

      It returned false, which is wrong.

      cc: Yin Huai Josh Rosen

      A false-negative considered previously:

      select '\\\\' rlike '.*\\\\\\\\.*';
      

      It returned true, which is correct if we assume that the pattern is treated as a Java string but not raw string.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mengxr Xiangrui Meng
                Reporter:
                mengxr Xiangrui Meng
              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: