Murshid Chalaev created HIVE-21950:
--------------------------------------

             Summary: Optimizer complicates execution plan of queries with 
SUBSTR function in EXISTS clause
                 Key: HIVE-21950
                 URL: https://issues.apache.org/jira/browse/HIVE-21950
             Project: Hive
          Issue Type: Bug
    Affects Versions: 3.1.1, 2.3.0
            Reporter: Murshid Chalaev


Queries with SUBSTR function in EXISTS clause have much more complicated 
execution plan in Hive-2.3 then it was in Hive-1.2. A query below has 8 stages 
which submit 4 MR jobs in Hive-2.3, while in Hive-1.2 it has 4 stages and 
submits 1 MR job. Without SUBSTR function or with disabled CBO in Hive-2.3 
execution plan is the same as in Hive-1.2 with enabled CBO.

 *STEPS TO REPRODUCE:*
{code:java}
CREATE TABLE i1122 (id STRING);
INSERT INTO i1122 VALUES (1),(1001); 

EXPLAIN
SELECT *
FROM i1122 AS t1
WHERE EXISTS (
    SELECT 1
    FROM i1122 AS t2
    WHERE t2.id = substr(t1.id,4)
);{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to