Venki Korukanti created DRILL-675:
-------------------------------------
Summary: Views created in dfs (with no workspace subschema) schema
are not be found when queried
Key: DRILL-675
URL: https://issues.apache.org/jira/browse/DRILL-675
Project: Apache Drill
Issue Type: Bug
Reporter: Venki Korukanti
Assignee: Venki Korukanti
Attachments: DRILL-675-1.patch
{code}
USE dfs;
+------------+------------+
| ok | summary |
+------------+------------+
| true | Default schema changed to 'dfs' |
+------------+------------+
1 row selected (0.098 seconds)
0: jdbc:drill:schema=hivestg> create view myView as select * from
dfs.`/opt/drill/raw-files/testTypes.json`;
+------------+------------+
| ok | summary |
+------------+------------+
| true | View 'myView' created successfully in 'dfs' schema |
+------------+------------+
1 row selected (0.128 seconds)
0: jdbc:drill:schema=hivestg> select * from myView;
Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while
running query.[error_id: "45b96c5d-5e37-4d9d-96bf-4a7c88be859b"
endpoint {
address: "localhost"
user_port: 31010
control_port: 31011
data_port: 31012
}
error_type: 0
message: "Failure while parsing sql. < ValidationException:[
org.eigenbase.util.EigenbaseContextException: From line 1, column 15 to line 1,
column 20 ] < EigenbaseContextException:[ From line 1, column 15 to line 1,
column 20 ] < SqlValidatorException:[ Table \'myView\' not found ]"
]
{code}
The problem is when you are using the 'dfs' as the current schema, view table
is created as part of the "dfs" schema in ViewStore. But when searching for a
table (or view) in "dfs" schema it looks at the tables in "default" schema
which has the schema path "dfs.default". As there is no view table with
"dfs.default" in ViewStore, it throws table not found error.
--
This message was sent by Atlassian JIRA
(v6.2#6252)