[
https://issues.apache.org/jira/browse/DRILL-4682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15389924#comment-15389924
]
ASF GitHub Bot commented on DRILL-4682:
---------------------------------------
Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/549#discussion_r71918817
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/CompoundIdentifierConverter.java
---
@@ -115,6 +119,18 @@ public SqlNode visitChild(
enableComplex = true;
}
}
+ if (expr.getKind() == SqlKind.SELECT) {
+ if (((SqlSelect) expr).getFrom() instanceof
DrillCompoundIdentifier) {
+ fullSchemasSet.add((DrillCompoundIdentifier) ((SqlSelect)
expr).getFrom());
+ } else if (((SqlSelect) expr).getFrom() instanceof SqlJoin) {
--- End diff --
Seems you are adding the schema-qualified table identifier. Will this logic
work for nested subqueries? Normally, the name resolution will happen under
certain name scope. I'm not clear that adding all the table identifier to this
"fullSchemasSet" will work for name scope based resolution.
Can you try some queries with nested subqueries with different
schema-qualified tables?
> Allow full schema identifier in SELECT clause
> ---------------------------------------------
>
> Key: DRILL-4682
> URL: https://issues.apache.org/jira/browse/DRILL-4682
> Project: Apache Drill
> Issue Type: Improvement
> Components: SQL Parser
> Reporter: Andries Engelbrecht
>
> Currently Drill requires aliases to identify columns in the SELECT clause
> when working with multiple tables/workspaces.
> Many BI/Analytical and other tools by default will use the full schema
> identifier in the select clause when generating SQL statements for execution
> for generic JDBC or ODBC sources. Not supporting this feature causes issues
> and a slower adoption of utilizing Drill as an execution engine within the
> larger Analytical SQL community.
> Propose to support
> SELECT <storage_plugin>.<workspace>.<table>.<column> FROM
> <storage_plugin>.<workspace>.<table>
> Also see DRILL-3510 for double quote support as per ANSI_QUOTES
> SELECT "<storage_plugin>"."<workspace>"."<table>"."<column>" FROM
> "<storage_plugin>"."<workspace>"."<table>"
> Which is very common generic SQL being generated by most tools when dealing
> with a generic SQL data source.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)