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

Yongzhi Chen commented on HIVE-11982:
-------------------------------------

I finally figured out the mystery of the query plan difference between unit 
test and local or cluster manual test:

The unit tests set hive.in.test to true through data/conf/hive-site.xml. This 
flag does a lot of magic, one of them is in 
static String canHandleQbForCbo(QueryProperties queryProperties, HiveConf 
conf,... method.
If I change the code
boolean isInTest = conf.getBoolVar(ConfVars.HIVE_IN_TEST);
to
boolean isInTest = false;

The unit test query plan will be same as manual tests. 

The problem is how to control the code in my qfile test.
I can not set hive.in.test to false in the qfile for it will throw exception on 
the set statement. Should we add a new property to check in canHandleQbForCbo 
method? (Something like NeedCheckHiveInTest and default to true?).






> Some test cases for union all fail with recent changes
> ------------------------------------------------------
>
>                 Key: HIVE-11982
>                 URL: https://issues.apache.org/jira/browse/HIVE-11982
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Yongzhi Chen
>            Assignee: Yongzhi Chen
>         Attachments: HIVE-11982.1.patch
>
>
> The tests throw java.lang.IndexOutOfBoundsException again. 
> It was supposed to be fixed by HIVE-11271



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to