You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Vitalii Diravka (JIRA)" <ji...@apache.org> on 2018/12/06 18:49:00 UTC

[jira] [Created] (DRILL-6885) CTAS for empty output doesn't create parquet file or folder

Vitalii Diravka created DRILL-6885:
--------------------------------------

             Summary: CTAS for empty output doesn't create parquet file or folder
                 Key: DRILL-6885
                 URL: https://issues.apache.org/jira/browse/DRILL-6885
             Project: Apache Drill
          Issue Type: Bug
    Affects Versions: 1.14.0
            Reporter: Vitalii Diravka
             Fix For: Future


CTAS for empty output can create empty tables based on the empty json or csv files. But it doesn't work for parquet files.
 See examples below:
{code:java}
0: jdbc:drill:zk=local> use dfs.tmp;
+-------+--------------------------------------+
|  ok   |               summary                |
+-------+--------------------------------------+
| true  | Default schema changed to [dfs.tmp]  |
+-------+--------------------------------------+
1 row selected (0.087 seconds)
0: jdbc:drill:zk=local> select * from `empty_dir`;
+--+
|  |
+--+
+--+
No rows selected (0.083 seconds)
0: jdbc:drill:zk=local> alter session set `store.format` = 'json';
+-------+------------------------+
|  ok   |        summary         |
+-------+------------------------+
| true  | store.format updated.  |
+-------+------------------------+
1 row selected (0.079 seconds)
0: jdbc:drill:zk=local> create table `empty_json` as select * from `empty_dir`;
+-----------+----------------------------+
| Fragment  | Number of records written  |
+-----------+----------------------------+
| 0_0       | 0                          |
+-----------+----------------------------+
1 row selected (0.128 seconds)
0: jdbc:drill:zk=local> select * from `empty_json`;
+--+
|  |
+--+
+--+
No rows selected (0.086 seconds)
0: jdbc:drill:zk=local> alter session set `store.format` = 'csv';
+-------+------------------------+
|  ok   |        summary         |
+-------+------------------------+
| true  | store.format updated.  |
+-------+------------------------+
1 row selected (0.073 seconds)
0: jdbc:drill:zk=local> create table `empty_csv` as select * from `empty_dir`;
+-----------+----------------------------+
| Fragment  | Number of records written  |
+-----------+----------------------------+
| 0_0       | 0                          |
+-----------+----------------------------+
1 row selected (0.135 seconds)
0: jdbc:drill:zk=local> select * from `empty_csv`;
+----------+
| columns  |
+----------+
| []       |
+----------+
1 row selected (0.086 seconds)
0: jdbc:drill:zk=local> alter session set `store.format` = 'parquet';
+-------+------------------------+
|  ok   |        summary         |
+-------+------------------------+
| true  | store.format updated.  |
+-------+------------------------+
1 row selected (0.073 seconds)
0: jdbc:drill:zk=local> create table `empty_parquet` as select * from `empty_dir`;
+-----------+----------------------------+
| Fragment  | Number of records written  |
+-----------+----------------------------+
| 0_0       | 0                          |
+-----------+----------------------------+
1 row selected (0.099 seconds)
0: jdbc:drill:zk=local> select * from `empty_parquet`;
20:41:01.619 [23f692c1-8994-9fc8-2ce4-5fc6135ebcc9:foreman] ERROR o.a.calcite.runtime.CalciteException - org.apache.calcite.sql.validate.SqlValidatorException: Object 'empty_parquet' not found
20:41:01.619 [23f692c1-8994-9fc8-2ce4-5fc6135ebcc9:foreman] ERROR o.a.calcite.runtime.CalciteException - org.apache.calcite.runtime.CalciteContextException: From line 1, column 15 to line 1, column 29: Object 'empty_parquet' not found
20:41:01.622 [Client-1] ERROR o.a.calcite.runtime.CalciteException - org.apache.calcite.sql.validate.SqlValidatorException: Object 'empty_parquet' not found
20:41:01.623 [Client-1] ERROR o.a.calcite.runtime.CalciteException - org.apache.calcite.runtime.CalciteContextException: From line 1, column 15 to line 1, column 29: Object 'empty_parquet' not found: Object 'empty_parquet' not found
Error: VALIDATION ERROR: From line 1, column 15 to line 1, column 29: Object 'empty_parquet' not found


[Error Id: 879730dc-aad6-4fc7-9c62-9ad8bbc99d42 on vitalii-pc:31010] (state=,code=0)
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)