[
https://issues.apache.org/jira/browse/DRILL-5215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15865413#comment-15865413
]
Khurram Faraaz commented on DRILL-5215:
---------------------------------------
Verified on Drill 1.10.0 commit ID : 300e9349
{noformat}
apache drill 1.10.0-SNAPSHOT
"the only truly happy people are children, the creative minority and drill
users"
0: jdbc:drill:schema=dfs.tmp> create table tbl1 as select * from ltbl;
+-----------+----------------------------+
| Fragment | Number of records written |
+-----------+----------------------------+
| 0_0 | 23 |
+-----------+----------------------------+
1 row selected (0.406 seconds)
0: jdbc:drill:schema=dfs.tmp> create view v1 as select * from tbl1;
+-------+-----------------------------------------------------+
| ok | summary |
+-------+-----------------------------------------------------+
| true | View 'v1' created successfully in 'dfs.tmp' schema |
+-------+-----------------------------------------------------+
1 row selected (0.332 seconds)
0: jdbc:drill:schema=dfs.tmp> drop table tbl1;
+-------+-----------------------+
| ok | summary |
+-------+-----------------------+
| true | Table [tbl1] dropped |
+-------+-----------------------+
1 row selected (0.194 seconds)
0: jdbc:drill:schema=dfs.tmp> create temporary table tbl1 as select * from ltbl;
+-----------+----------------------------+
| Fragment | Number of records written |
+-----------+----------------------------+
| 0_0 | 23 |
+-----------+----------------------------+
1 row selected (0.315 seconds)
0: jdbc:drill:schema=dfs.tmp> select * from v1;
Error: VALIDATION ERROR: Temporary tables usage is disallowed. Used temporary
table name: [tbl1].
SQL Query null
[Error Id: 05783bdd-6c61-47ad-88d7-5e47882a9f45 on centos-01.qa.lab:31010]
(state=,code=0)
0: jdbc:drill:schema=dfs.tmp>
{noformat}
> CTTAS: disallow temp tables in view expansion logic
> ---------------------------------------------------
>
> Key: DRILL-5215
> URL: https://issues.apache.org/jira/browse/DRILL-5215
> Project: Apache Drill
> Issue Type: Improvement
> Affects Versions: 1.10.0
> Reporter: Arina Ielchiieva
> Assignee: Arina Ielchiieva
> Fix For: 1.10.0
>
>
> This Jira is addressing last two CR comments in PR for Jira DRILL-4956:
> 1. Disallow temp tables in view expansion logic.
> Steps to reproduce:
> a. use default temporary workspace.
> b. create persistent table with name t:
> c. create view over persistent table.
> d. drop persistent table.
> e. create temporary table with the same name as persistent table.
> f. select from view
> Currently Drill returns result on step f but should return error message.
> {noformat}
> VALIDATION ERROR: Temporary tables usage is disallowed. Used temporary table
> name: t
> {noformat}
> {noformat}
> use dfs.tmp;
> create table t as select 'TABLE' from (values(1));
> create view v as select * from t;
> select * from v;
> +---------+
> | EXPR$0 |
> +---------+
> | TABLE |
> +---------+
> drop table t;
> create temporary table t as select 'TEMP' from (values(1));
> select * from v;
> +---------+
> | EXPR$0 |
> +---------+
> | TEMP |
> +---------+
> {noformat}
> 2. Replace link to gist with CTTAS design doc to Jira link.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)