[ 
https://issues.apache.org/jira/browse/DRILL-4812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kunal Khatua closed DRILL-4812.
-------------------------------

Verified on Windows 10 by creating a nested table of nation  (25row parquet 
file) with a directory structure of 2 level-1 dirs (a,b), 3 level-2 dirs 
(1,2,3) and 3 level-3 dirs (yes,no, idk).

{code}
0: jdbc:drill:zk=local> select count(n_nationkey) from 
dfs.root.`/drill/nation/a/1/idk/part-m-00000.parquet`;
+---------+
| EXPR$0  |
+---------+
| 25      |
+---------+
1 row selected (0.178 seconds)
0: jdbc:drill:zk=local> select count(n_nationkey) from 
dfs.root.`/drill/nation/a/1/idk`;
+---------+
| EXPR$0  |
+---------+
| 25      |
+---------+
1 row selected (0.169 seconds)
0: jdbc:drill:zk=local> select count(n_nationkey) from 
dfs.root.`/drill/nation/a/*/idk`;
+---------+
| EXPR$0  |
+---------+
| 75      |
+---------+
1 row selected (0.167 seconds)
0: jdbc:drill:zk=local> select count(n_nationkey) from 
dfs.root.`/drill/nation/*/*/idk`;
+---------+
| EXPR$0  |
+---------+
| 150     |
+---------+
1 row selected (0.226 seconds)
0: jdbc:drill:zk=local> select count(n_nationkey) from 
dfs.root.`/drill/nation/*/*/*`;
+---------+
| EXPR$0  |
+---------+
| 450     |
+---------+
1 row selected (0.225 seconds)
{code}

> 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, ready-to-commit, windows
>             Fix For: 1.10.0
>
>
> 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.15#6346)

Reply via email to