Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
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 ]" ]
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.
Attachments
Attachments
Issue Links
- depends upon
-
DRILL-679 Support create table as query (CTAS)
- Closed