Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Issuing the query:
select * alias from `dfs.tmp`.`empty_file.json` ;
(where /tmp/empty_file.json exists and is completely empty) yields an internal error:
> select * alias from `dfs.tmp`.`empty_file.json` ;
Error: SYSTEM ERROR: Unexpected exception during fragment initialization: index (-1) must not be negative
[Error Id: 633d45db-5d05-4b15-84ee-88eaf11e9ba2 on dev-linux2:31010] (state=,code=0)
>
It doesn't seem to matter whether the input file is empty or contains some JSON.
(Using a table from INFORMATION_SCHEMA (a schema whose tables and columns are known statically) does not yield the same error:
> select * alias from INFORMATION_SCHEMA.CATALOGS;
May 04, 2015 11:49:01 PM org.apache.calcite.sql.validate.SqlValidatorException <init>
SEVERE: org.apache.calcite.sql.validate.SqlValidatorException: Unknown identifier '*'
May 04, 2015 11:49:01 PM org.apache.calcite.runtime.CalciteException <init>
SEVERE: org.apache.calcite.runtime.CalciteContextException: At line 1, column 8: Unknown identifier '*'
Error: PARSE ERROR: At line 1, column 8: Unknown identifier '*'
[Error Id: 1504c5cd-9c60-44ec-b4f2-dad837329bff on dev-linux2:31010] (state=,code=0)
>
However, that error doesn't seem right either. (I would think that trying to give an alias name after "*" would be a syntax error (rather than a name lookup error).))