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

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

arina-ielchiieva commented on pull request #2043: DRILL-7673: View set query 
fails with NPE for non-existing option
URL: https://github.com/apache/drill/pull/2043#discussion_r399662074
 
 

 ##########
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/planner/sql/handlers/SetOptionHandlerTest.java
 ##########
 @@ -59,32 +63,41 @@ public void testSimpleSetQuery() throws Exception {
 
   @Test
   public void testViewSetQuery() throws Exception {
-    client.testBuilder()  // BIT
+    testBuilder()  // BIT
         .sqlQuery("SET `%s`", ExecConstants.ENABLE_ITERATOR_VALIDATION_OPTION)
         .unOrdered()
         .sqlBaselineQuery("SELECT name, val as value FROM sys.options where 
name = '%s' limit 1",
             ExecConstants.ENABLE_ITERATOR_VALIDATION_OPTION)
         .go();
 
-    client.testBuilder()  // BIGINT
+    testBuilder()  // BIGINT
         .sqlQuery("SET `%s`", ExecConstants.OUTPUT_BATCH_SIZE)
         .unOrdered()
         .sqlBaselineQuery("SELECT name, val as value FROM sys.options where 
name = '%s' limit 1",
             ExecConstants.OUTPUT_BATCH_SIZE)
         .go();
 
-    client.testBuilder()  // FLOAT
+    testBuilder()  // FLOAT
         .sqlQuery("SET `%s`", ExecConstants.OUTPUT_BATCH_SIZE_AVAIL_MEM_FACTOR)
         .unOrdered()
         .sqlBaselineQuery("SELECT name, val as value FROM sys.options where 
name = '%s' limit 1",
             ExecConstants.OUTPUT_BATCH_SIZE_AVAIL_MEM_FACTOR)
         .go();
 
-    client.testBuilder()  // VARCHAR
+    testBuilder()  // VARCHAR
         .sqlQuery("SET `%s`", ExecConstants.FILESYSTEM_PARTITION_COLUMN_LABEL)
         .unOrdered()
         .sqlBaselineQuery("SELECT name, val as value FROM sys.options where 
name = '%s' limit 1",
             ExecConstants.FILESYSTEM_PARTITION_COLUMN_LABEL)
         .go();
   }
+
+  @Test
+  public void testViewSetWithIncorrectOption() throws Exception {
+    try {
+      run("set `non-existing option`");
 
 Review comment:
   Add fail() to ensure method call has failed...
 
----------------------------------------------------------------
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:
[email protected]


> View set query fails with NPE for non-existing option
> -----------------------------------------------------
>
>                 Key: DRILL-7673
>                 URL: https://issues.apache.org/jira/browse/DRILL-7673
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.17.0
>            Reporter: Vova Vysotskyi
>            Assignee: Vova Vysotskyi
>            Priority: Minor
>             Fix For: 1.18.0
>
>
> The following query fails with NPE:
> {code:sql}
> set `non-existing option`
> {code}
> Stack trace:
> {noformat}
> Caused by: java.lang.NullPointerException: null
>       at 
> org.apache.drill.exec.planner.sql.handlers.SetOptionHandler.getPlan(SetOptionHandler.java:66)
>       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:140)
>       at 
> org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:93)
>       at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:592)
>       at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:277)
>       ... 3 common frames omitted
> {noformat}
> Also, the result of the command returns option name with the same case as it 
> was specified in the query:
> {noformat}
> set `metastore.ENABLED`;
> +-------------------+-------+
> |       name        | value |
> +-------------------+-------+
> | metastore.ENABLED | false |
> +-------------------+-------+
> {noformat}



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

Reply via email to