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

Jesus Camacho Rodriguez edited comment on HIVE-17510 at 9/12/17 2:47 AM:
-------------------------------------------------------------------------

[~gopalv], that would make sense: ascending selectivity for AND (less selective 
first) and descending for OR. Observe however that this fix only applies to 
explain plans in test mode (it's purpose was only remove the determinism in the 
explain for the tests). I think we could check in this fix to unlock 
HIVE-17432. Or maybe I should just create the fix with the sort on selectivity 
for all cases and cancel this one (I would still need to provide determinism 
for testing in case of selectivity draw). Thoughts? Cc [~ashutoshc]


was (Author: jcamachorodriguez):
[~gopalv], that would make sense: ascending selectivity for AND (less selective 
first) and descending for OR. Observe however that this fix only applies to 
explain plans in test mode (it's purpose was only remove the determinism in the 
explain for the tests). I think we could check in both fixes to provide this 
determinism for testing (if wanted). Or maybe I should just create the fix with 
the sort on selectivity for all cases and cancel this one... Thoughts? Cc 
[~ashutoshc]

> Make comparison of filter predicates in q files deterministic
> -------------------------------------------------------------
>
>                 Key: HIVE-17510
>                 URL: https://issues.apache.org/jira/browse/HIVE-17510
>             Project: Hive
>          Issue Type: Bug
>          Components: Testing Infrastructure
>    Affects Versions: 3.0.0
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>         Attachments: HIVE-17510.patch
>
>
> I have been hitting this issue while submitting patches to test HIVE-17432.
> Basically, the order on which the rewriting might create the children of AND 
> operations is not deterministic. Thus, tests might fail because the created 
> golden file is not the same, thought the test should pass because they just 
> simply do not follow same order:
> {code}
> predicate: ((d_year >= 1992) and (d_year <= 1997) and ((c_city = 'UNITED 
> KI1') or (c_city = 'UNITED KI5')) and ((s_city = 'UNITED KI1') or (s_city = 
> 'UNITED KI5'))) (type: boolean)
> {code}
> {code}
> predicate: ((d_year <= 1997) and (d_year >= 1992) and ((c_city = 'UNITED 
> KI1') or (c_city = 'UNITED KI5')) and ((s_city = 'UNITED KI1') or (s_city = 
> 'UNITED KI5'))) (type: boolean)
> {code}
> This patches fixes the issue by sorting the children of some expressions 
> (currently AND and OR children) when we run explain plan and we are running 
> in test mode.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to