You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/03/17 14:31:00 UTC

[jira] [Commented] (DRILL-7643) Fix issues with using columns with the same name as reserved keyword

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

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
 
 
   # [DRILL-7643](https://issues.apache.org/jira/browse/DRILL-7643): Fix issues with using columns with the same name as a reserved keyword
   
   ## Description
   
   `SchemaPath.parseFromString()` method takes into an account reserved words and spaces in column names, so if the column wasn't escaped, it may fail, for example, the following calls will fail: `SchemaPath.parseFromString("date")`, `SchemaPath.parseFromString("column name")`, but the following calls are valid: ``SchemaPath.parseFromString("`date`")``, ``SchemaPath.parseFromString("`column name`")``.
   
   Revised usages of this method and replaced it where needed.
   
   ## Documentation
   NA
   
   ## Testing
   Updated existing tests to check this issue. Ran all tests suite.
   
 
----------------------------------------------------------------
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:
users@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
>             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)