drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdiravka <...@git.apache.org>
Subject [GitHub] drill pull request #549: DRILL-4682: Allow full schema identifier in SELECT ...
Date Fri, 22 Jul 2016 18:13:21 GMT
Github user vdiravka commented on a diff in the pull request:

    https://github.com/apache/drill/pull/549#discussion_r71921608
  
    --- 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 --
    
    Do you ask about clarification/github comment or code comment?
    Calcite parses the query with schema name in column name correctly. Then Drill reconverts
SqlNode for supporting complex types [DRILL-932](https://issues.apache.org/jira/browse/DRILL-932).

    But it was hardcoded: handled everything post two index as item operator (For column name
in select clause `cp.employee.json.employee_id` SqlNode was `cp.employee.json['department_id']`
instead of `cp.employee.json.department_id`).
    I added the case when full schema identifier is used in select clause to handle everything
post two index (except schema identifier) as item operator. I made it by comparing column
names identifiers with full schema identifiers from `from` and `join` clauses


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message