Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-1831

LIKE operator not working with SQL [charlist] Wildcard

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: Functions - Drill
    • Labels:
      None

      Description

      git.commit.id.abbrev=142e577

      Data :

      abc
      def
      acf
      fgh
      qjh
      

      The below query works fine

      0: jdbc:drill:schema=dfs.drillTestDir> select columns[0] from `data-shapes/temp.tbl` where columns[0] like '%b%';
      +------------+
      |   EXPR$0   |
      +------------+
      | abc        |
      +------------+
      1 row selected (0.122 seconds)
      

      However the below query does not return anything

      0: jdbc:drill:schema=dfs.drillTestDir> select columns[0] from `data-shapes/temp.tbl` where columns[0] like '[aq]%';
      +------------+
      |   EXPR$0   |
      +------------+
      +------------+
      No rows selected (0.139 seconds)
      

      The above query should return values which start with either 'a' or 'q'.

      Text Plan :

      00-00    Screen
      00-01      Project(EXPR$0=[$0])
      00-02        SelectionVectorRemover
      00-03          Filter(condition=[LIKE($0, '[aq]%')])
      00-04            Project(ITEM=[ITEM($0, 0)])
      00-05              Scan(groupscan=[EasyGroupScan [selectionRoot=/drill/testdata/data-shapes/temp.tbl, numFiles=1, columns=[`columns`[0]], files=[maprfs:/drill/testdata/data-shapes/temp.tbl]]])
      

      Let me know if you need anything else

        Attachments

          Activity

            People

            • Assignee:
              rkins Rahul Challapalli
              Reporter:
              rkins Rahul Challapalli
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: