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

Wildcard queries fail on Windows

    XMLWordPrintableJSON

Details

    Description

      Wildcards within the path of a query are not handled on windows and result in a "String index out of range" exception.

      for example:

      0: jdbc:drill:zk=local> SELECT SUM(qty) as num FROM dfs.parquet.`/trends/2016/1/*/*/3701`;
      Error: VALIDATION ERROR: String index out of range: -1
      
      SQL Query null
      

      The problem exists within:

      exec\java-exec\src\main\java\org\apache\drill\exec\store\dfs\FileSelection.java

      private static Path handleWildCard(final String root)

      This function is looking for the index of the system specific PATH_SEPARATOR which on windows is '\' (from System.getProperty("file.separator")). The path passed in to handleWildcard will not ever have those type of path separators as the Path constructor (from org.apache.hadoop.fs.Path) sets all the path separators to '/'.

      NOTE:

      private static String removeLeadingSlash(String path)

      in that same file explicitly looks for '/' and does not use the system specific PATH_SEPARATOR.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mike@ingrooves.com Mike Lavender
              Kunal Khatua Kunal Khatua
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: