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

SQL LIKE does not handle backslashes correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.1.1, 2.2.0
    • SQL

    Description

      Try the following in SQL shell:

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

      It returned false, which is wrong.

      cc: yhuai joshrosen

      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

              mengxr Xiangrui Meng
              mengxr Xiangrui Meng
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: