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

[jira] [Work logged] (HIVE-24233) except subquery throws nullpointer with cbo disabled

     [ https://issues.apache.org/jira/browse/HIVE-24233?focusedWorklogId=507076&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-507076 ]

ASF GitHub Bot logged work on HIVE-24233:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Nov/20 14:17
            Start Date: 03/Nov/20 14:17
    Worklog Time Spent: 10m 
      Work Description: pvary commented on a change in pull request #1555:
URL: https://github.com/apache/hive/pull/1555#discussion_r516640708



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
##########
@@ -11628,6 +11628,11 @@ private void setupStats(TableScanDesc tsDesc, QBParseInfo qbp, Table tab, String
   }
 
   private Operator genPlan(QB parent, QBExpr qbexpr) throws SemanticException {
+    if (qbexpr.getOpcode() == QBExpr.Opcode.EXCEPT || qbexpr.getOpcode() == QBExpr.Opcode.EXCEPTALL
+        || qbexpr.getOpcode() == QBExpr.Opcode.INTERSECT || qbexpr.getOpcode() == QBExpr.Opcode.INTERSECTALL) {
+      throw new SemanticException(
+          "Except and intersect operations are only supported with Cost Based Optimizations enabled. Turn on hive.cbo.enable");

Review comment:
       Could we say instead or something like it?
   ```
   "EXCEPT and INTERSECT operations are only supported with Cost Based Optimizations enabled. Please set 'hive.cbo.enable' to true"
   ```

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
##########
@@ -11628,6 +11628,11 @@ private void setupStats(TableScanDesc tsDesc, QBParseInfo qbp, Table tab, String
   }
 
   private Operator genPlan(QB parent, QBExpr qbexpr) throws SemanticException {
+    if (qbexpr.getOpcode() == QBExpr.Opcode.EXCEPT || qbexpr.getOpcode() == QBExpr.Opcode.EXCEPTALL
+        || qbexpr.getOpcode() == QBExpr.Opcode.INTERSECT || qbexpr.getOpcode() == QBExpr.Opcode.INTERSECTALL) {
+      throw new SemanticException(
+          "Except and intersect operations are only supported with Cost Based Optimizations enabled. Turn on hive.cbo.enable");

Review comment:
       Could we say instead or something like this?
   ```
   "EXCEPT and INTERSECT operations are only supported with Cost Based Optimizations enabled. Please set 'hive.cbo.enable' to true"
   ```

##########
File path: ql/src/test/queries/clientnegative/except_cbooff.q
##########
@@ -0,0 +1,5 @@
+set hive.cbo.enable=false;

Review comment:
       Do we have positive tests?




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 507076)
    Time Spent: 20m  (was: 10m)

> except subquery throws nullpointer with cbo disabled
> ----------------------------------------------------
>
>                 Key: HIVE-24233
>                 URL: https://issues.apache.org/jira/browse/HIVE-24233
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Peter Varga
>            Assignee: Peter Varga
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Except and intersect was only implemented with Calcite in HIVE-12764. If cbo is disabled it would just throw a nullpointer exception. We should at least throw a SemanticException stating this is not supported.
> Repro:
> set hive.cbo.enable=false;
> create table test(id int);
> insert into table test values(1);
> select id from test except select id from test;



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