[ 
https://issues.apache.org/jira/browse/DRILL-4812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15596385#comment-15596385
 ] 

ASF GitHub Bot commented on DRILL-4812:
---------------------------------------

GitHub user mlavende opened a pull request:

    https://github.com/apache/drill/pull/627

    DRILL-4812: Fix for detecting wildcards in paths when running on windows

    By the time the path makes it to the `handleWildCard` method the separators 
have all been normalized to the forward slash.  This method, like 
`removeLeadingSlash` are safe, and must only check directly for the `/` 
separator.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mlavende/drill fix-wildcard-windows

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/627.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #627
    
----
commit 7bd8f78d3283a59b7753e5ef13c64f1e7490eed4
Author: Mike Lavender <mike lavender>
Date:   2016-10-21T21:05:43Z

    Fix for detecting wildcards in paths when running on windows

----


> Wildcard queries fail on Windows
> --------------------------------
>
>                 Key: DRILL-4812
>                 URL: https://issues.apache.org/jira/browse/DRILL-4812
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Storage - Other
>    Affects Versions: 1.7.0
>         Environment: Windows 7
>            Reporter: Mike Lavender
>              Labels: easyfix, easytest, windows
>
> Wildcards within the path of a query are not handled on windows and result in 
> a "String index out of range" exception.
> for example:
> {noformat}
> 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
> {noformat}
> ----
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to