[
https://issues.apache.org/jira/browse/DRILL-1029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xiao Meng updated DRILL-1029:
-----------------------------
Description:
When using the following custom SQL to import data in Tableau,
{code}
select * from dfs.`default`.`/opt/drill/raw-files/click1.json`
{code}
Tableau will generate a query like
{code}
SELECT `TableauSQL`.`address` AS `address`,
`TableauSQL`.`br` AS `br`,
`TableauSQL`.`first_visit` AS `first_visit`,
`TableauSQL`.`gender` AS `gender`,
`TableauSQL`.`id` AS `id`,
`TableauSQL`.`la` AS `la`,
`TableauSQL`.`name` AS `name`,
`TableauSQL`.`os` AS `os`,
`TableauSQL`.`st` AS `st`,
`TableauSQL`.`user_category` AS `user_category`
FROM (
select * from dfs.`default`.`/opt/drill/raw-files/click1.json`
) `TableauSQL`
{code}
but this query will fail.
It seems happened in all schema-less file types when you run query in the form
of select column from a `select *` sub-query.
For example, we observed this in SQLline:
{code}
0: jdbc:drill:local=localhost:31010> select L_ORDERKEY from
cp.`tpch/lineitem.parquet` limit 1;
+------------+
| L_ORDERKEY |
+------------+
| 1 |
+------------+
1 row selected (0.835 seconds)
0: jdbc:drill:local=localhost:31010> select L_ORDERKEY from (select * from
cp.`tpch/lineitem.parquet` limit 1);
Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while
running query.[error_id: "3a387934-9cca-4f3a-8f37-74cdca365113"
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 8 to line 1,
column 17 ] < EigenbaseContextException:[ From line 1, column 8 to line 1,
column 17 ] < SqlValidatorException:[ Column 'L_ORDERKEY' not found in any
table ]"
]
Error: exception while executing query (state=,code=0)
{code}
This will block using custom SQL for schema-less file in Tableau.
was:
The following query is generated by Tableau to import data from custom SQL.
{code}
SELECT `TableauSQL`.`address` AS `address`,
`TableauSQL`.`br` AS `br`,
`TableauSQL`.`first_visit` AS `first_visit`,
`TableauSQL`.`gender` AS `gender`,
`TableauSQL`.`id` AS `id`,
`TableauSQL`.`la` AS `la`,
`TableauSQL`.`name` AS `name`,
`TableauSQL`.`os` AS `os`,
`TableauSQL`.`st` AS `st`,
`TableauSQL`.`user_category` AS `user_category`
FROM (
select * from dfs.`default`.`/opt/drill/raw-files/click1.json`
) `TableauSQL`
{code}
But the query will failed.
Similarly, it will happen in other schema-less file types.
For example,
{code}
0: jdbc:drill:local=localhost:31010> select L_ORDERKEY from
cp.`tpch/lineitem.parquet` limit 1;
+------------+
| L_ORDERKEY |
+------------+
| 1 |
+------------+
1 row selected (0.835 seconds)
0: jdbc:drill:local=localhost:31010> select L_ORDERKEY from (select * from
cp.`tpch/lineitem.parquet` limit 1);
Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while
running query.[error_id: "3a387934-9cca-4f3a-8f37-74cdca365113"
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 8 to line 1,
column 17 ] < EigenbaseContextException:[ From line 1, column 8 to line 1,
column 17 ] < SqlValidatorException:[ Column 'L_ORDERKEY' not found in any
table ]"
]
Error: exception while executing query (state=,code=0)
{code}
This will block using custom SQL for schema-less file in Tableau.
> select column from a `select *` sub-query fails for schema-less file
> --------------------------------------------------------------------
>
> Key: DRILL-1029
> URL: https://issues.apache.org/jira/browse/DRILL-1029
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Xiao Meng
> Priority: Critical
> Labels: Tableau
>
> When using the following custom SQL to import data in Tableau,
> {code}
> select * from dfs.`default`.`/opt/drill/raw-files/click1.json`
> {code}
> Tableau will generate a query like
> {code}
> SELECT `TableauSQL`.`address` AS `address`,
> `TableauSQL`.`br` AS `br`,
> `TableauSQL`.`first_visit` AS `first_visit`,
> `TableauSQL`.`gender` AS `gender`,
> `TableauSQL`.`id` AS `id`,
> `TableauSQL`.`la` AS `la`,
> `TableauSQL`.`name` AS `name`,
> `TableauSQL`.`os` AS `os`,
> `TableauSQL`.`st` AS `st`,
> `TableauSQL`.`user_category` AS `user_category`
> FROM (
> select * from dfs.`default`.`/opt/drill/raw-files/click1.json`
> ) `TableauSQL`
> {code}
> but this query will fail.
> It seems happened in all schema-less file types when you run query in the
> form of select column from a `select *` sub-query.
> For example, we observed this in SQLline:
> {code}
> 0: jdbc:drill:local=localhost:31010> select L_ORDERKEY from
> cp.`tpch/lineitem.parquet` limit 1;
> +------------+
> | L_ORDERKEY |
> +------------+
> | 1 |
> +------------+
> 1 row selected (0.835 seconds)
> 0: jdbc:drill:local=localhost:31010> select L_ORDERKEY from (select * from
> cp.`tpch/lineitem.parquet` limit 1);
> Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while
> running query.[error_id: "3a387934-9cca-4f3a-8f37-74cdca365113"
> 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 8 to line
> 1, column 17 ] < EigenbaseContextException:[ From line 1, column 8 to line 1,
> column 17 ] < SqlValidatorException:[ Column 'L_ORDERKEY' not found in any
> table ]"
> ]
> Error: exception while executing query (state=,code=0)
> {code}
> This will block using custom SQL for schema-less file in Tableau.
--
This message was sent by Atlassian JIRA
(v6.2#6252)