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

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

vvysotskyi commented on pull request #2028: DRILL-7643: Fix issues with using 
columns with the same name as a reserved keyword
URL: https://github.com/apache/drill/pull/2028#discussion_r395072672
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/ischema/RecordCollector.java
 ##########
 @@ -318,36 +319,39 @@ public MetastoreRecordCollector(Metastore metastore, 
FilterEvaluator filterEvalu
      * @param schemaPath schema name
      * @param table table instance
      * @param schema table or column schema
-     * @param parentColumnName parent column name if any
+     * @param parentColumnNames list of parent column names if any
      * @param columnIndex column index if any
      * @param isNested indicates if column is nested
      * @return list of column records
      */
     private List<Records.Column> columns(String schemaPath,
                                          BaseTableMetadata table,
                                          TupleMetadata schema,
-                                         String parentColumnName,
+                                         List<String> parentColumnNames,
 
 Review comment:
   This is a list that contains unquoted names of columns parent to this 
column. For example, for column `a.b.c.d`, when a column `d` will be handled in 
this method, the list would contain (`a`, `b`, `c`) columns. Array brackets are 
ignored.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Fix issues with using columns with the same name as reserved keyword
> --------------------------------------------------------------------
>
>                 Key: DRILL-7643
>                 URL: https://issues.apache.org/jira/browse/DRILL-7643
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.16.0, 1.17.0
>            Reporter: Vova Vysotskyi
>            Assignee: Vova Vysotskyi
>            Priority: Major
>              Labels: ready-to-commit
>             Fix For: 1.18.0
>
>
> Parquet refresh metadata fails when an interesting column name is the same as 
> the reserved keyword.
> Steps to reproduce:
> 1. Create a parquet table with column name date:
> {code:sql}
> create table dfs.tmp.t11 as (select 1 as `date`, 2 as c);
> {code}
> 2. Run REFRESH METADATA command with specifying that interesting column:
> {code:sql}
> refresh table metadata columns (`date`) dfs.tmp.t11;
> {code}
> This query returns the following result:
> {noformat}
> +-------+----------------------------------------------------------------------------------+
> |  ok   |                                     summary                         
>              |
> +-------+----------------------------------------------------------------------------------+
> | false | Error: mismatched input 'date' expecting {'if', 'case', 'cast', 
> Convert, AnyValue, '!', '+', '-', '(', ''', Bool, Number, Identifier, 
> QuotedIdentifier, String} |
> +-------+----------------------------------------------------------------------------------+
> {noformat}
> Stack trace from logs:
> {noformat}
> 2020-03-16 19:38:45,539 [2190465a-567b-575b-5b05-d747908789e7:foreman] ERROR 
> o.a.d.e.p.s.h.RefreshMetadataHandler - Failed to update metadata for table 
> 't11'
> org.apache.drill.common.exceptions.ExpressionParsingException: mismatched 
> input 'date' expecting {'if', 'case', 'cast', Convert, AnyValue, '!', '+', 
> '-', '(', ''', Bool, Number, Identifier, QuotedIdentifier, String}
>       at 
> org.apache.drill.common.parser.ErrorListener.syntaxError(ErrorListener.java:35)
>       at 
> org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
>       at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
>       at 
> org.antlr.v4.runtime.DefaultErrorStrategy.reportInputMismatch(DefaultErrorStrategy.java:327)
>       at 
> org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:139)
>       at 
> org.apache.drill.common.expression.parser.ExprParser.expression(ExprParser.java:1704)
>       at 
> org.apache.drill.common.expression.parser.ExprParser.parse(ExprParser.java:202)
>       at 
> org.apache.drill.common.parser.LogicalExpressionParser.parse(LogicalExpressionParser.java:51)
>       at 
> org.apache.drill.common.expression.SchemaPath.parseFromString(SchemaPath.java:202)
>       at 
> org.apache.drill.exec.planner.sql.handlers.RefreshMetadataHandler.getColumnRootSegments(RefreshMetadataHandler.java:151)
>       at 
> org.apache.drill.exec.planner.sql.handlers.RefreshMetadataHandler.getPlan(RefreshMetadataHandler.java:81)
>       at 
> org.apache.drill.exec.planner.sql.DrillSqlWorker.getQueryPlan(DrillSqlWorker.java:283)
>       at 
> org.apache.drill.exec.planner.sql.DrillSqlWorker.getPhysicalPlan(DrillSqlWorker.java:163)
>       at 
> org.apache.drill.exec.planner.sql.DrillSqlWorker.convertPlan(DrillSqlWorker.java:128)
>       at 
> org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:93)
>       at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:590)
>       at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:275)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>       at java.lang.Thread.run(Thread.java:748)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to