[ 
https://issues.apache.org/jira/browse/DRILL-4682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15390007#comment-15390007
 ] 

ASF GitHub Bot commented on DRILL-4682:
---------------------------------------

Github user julianhyde commented on a diff in the pull request:

    https://github.com/apache/drill/pull/549#discussion_r71924583
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/DrillCompoundIdentifier.java
 ---
    @@ -69,31 +70,38 @@ public void addIndex(int index, SqlParserPos pos){
         }
       }
     
    -  public SqlNode getAsSqlNode(){
    -    if(ids.size() == 1){
    +  public SqlNode getAsSqlNode(Set<DrillCompoundIdentifier> fullSchemasSet) 
{
    --- End diff --
    
    Calcite has a concept of a "namespace" that abstracts what columns are 
available in a table or sub-query. I think you should be using that rather than 
looking at the structure of the parse tree.
    
    There's a lot of code here, and it seems to duplicate (in a less general 
way) what is being done in Calcite. It's technical debt, and let me explain how 
it will bite Drill. I am working right now on 
https://issues.apache.org/jira/browse/CALCITE-1208 and making some significant 
changes to how name-resolution works. When I check in CALCITE-1208 there's a 
strong chance that the code in this PR will break, and as a result, it will 
take Drill even longer to get back onto Calcite master branch.


> 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)

Reply via email to