[
https://issues.apache.org/jira/browse/DRILL-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14900824#comment-14900824
]
Deneche A. Hakim commented on DRILL-3813:
-----------------------------------------
enabling {{exec.errors.verbose}} confirms it's the same issue:
{noformat}
0: jdbc:drill:zk=local> select * from dfs.tmp.empty;
Error: VALIDATION ERROR: Index: 0, Size: 0
[Error Id: 694cec43-8529-4f59-876a-8084576b380e on 172.30.1.109:31010]
(org.apache.calcite.tools.ValidationException)
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
org.apache.calcite.prepare.PlannerImpl.validate():179
org.apache.calcite.prepare.PlannerImpl.validateAndGetType():188
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateNode():447
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert():190
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():159
...
Caused By (java.lang.IndexOutOfBoundsException) Index: 0, Size: 0
java.util.ArrayList.rangeCheck():635
java.util.ArrayList.get():411
org.apache.drill.exec.store.dfs.FileSelection.getFirstPath():100
org.apache.drill.exec.store.dfs.BasicFormatMatcher.isReadable():75
org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.create():338
org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.create():153
org.apache.drill.exec.planner.sql.ExpandingConcurrentMap.getNewEntry():96
org.apache.drill.exec.planner.sql.ExpandingConcurrentMap.get():90
org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.getTable():276
org.apache.calcite.jdbc.SimpleCalciteSchema.getTable():83
...
{noformat}
> table from directory subtree having no descendent files fails with index error
> ------------------------------------------------------------------------------
>
> Key: DRILL-3813
> URL: https://issues.apache.org/jira/browse/DRILL-3813
> Project: Apache Drill
> Issue Type: Bug
> Components: SQL Parser, Storage - Other
> Reporter: Daniel Barclay (Drill)
> Assignee: Aman Sinha
>
> Trying to use as a table a directory subtree that has no descendent files
> (but zero or more descendent directories) yields what seems to be a partially
> handled index out-of-bounds condition.
> For example, with {{/tmp/empty_directory}} being an empty directory:
> {noformat}
> 0: jdbc:drill:zk=local> SELECT * FROM `dfs`.`tmp`.`empty_directory`;
> Error: VALIDATION ERROR: Index: 0, Size: 0
> [Error Id: 747425c9-5350-4813-9f0d-ecf580e15101 on dev-linux2:31010]
> (state=,code=0)
> 0: jdbc:drill:zk=local>
> {noformat}
> Also, with {{/tmp/no_child_files_subtree}} having two child directories and a
> grandchild directory, but not descendent files:
> {noformat}
> 0: jdbc:drill:zk=local> SELECT * FROM `dfs`.`tmp`.`no_child_files_subtree`;
> Error: VALIDATION ERROR: Index: 0, Size: 0
> [Error Id: abc90424-8434-4403-b44b-0ba69ef43151 on dev-linux2:31010]
> (state=,code=0)
> 0: jdbc:drill:zk=local>
> {noformat}
> A directory subtree having no files was expected to be taken as a table with
> no rows (and a null schema).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)