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

Stamatis Zampetakis commented on HIVE-25952:
--------------------------------------------

I revived this proposal on top of recent master (commit 
6c7e972247957976fd12e9bbc4fb9343ffa78a71) in PR#6061 and the tests came back 
green. In terms of plan changes the impact was minimal since only three query 
plans were affected. Probably the recent Calcite upgrade to 1.33.0 (HIVE-27102) 
played a role. The differences can be seen in GitHub but I am attaching also a 
small diff in [^6061-plan-changes.txt] just in case.

The plans before and after PR#6061 are equivalent but the new ones are somewhat 
less efficient since they miss some predicate simplifications. Once 
CALCITE-7160 is merged the simplifications will be performed and the plans 
before and after will be identical.

Although, we could proceed and merge PR#6061, at this stage there is no strong 
reason to rush it. We could continue this work once CALCITE-7160 gets merged 
and Hive upgrades to a Calcite version >= 1.41.0.

> Drop HiveRelMdPredicates::getPredicates(Project...) to use that of 
> RelMdPredicates
> ----------------------------------------------------------------------------------
>
>                 Key: HIVE-25952
>                 URL: https://issues.apache.org/jira/browse/HIVE-25952
>             Project: Hive
>          Issue Type: Sub-task
>          Components: CBO
>    Affects Versions: 4.0.0
>            Reporter: Alessandro Solimando
>            Assignee: Alessandro Solimando
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: 6061-plan-changes.txt
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> There are some differences on this method between Hive and Calcite, the idea 
> of this ticket is to unify the two methods, and then drop the override in 
> HiveRelMdPredicates in favour of the method of RelMdPredicates.
> After applying HIVE-25966, the only difference is in the test for constant 
> expressions, which can be summarized as follows:
> ||Expression Type|Is Constant for Hive?||Is Constant for Calcite?||
> |InputRef|False|False|
> |Call|True if function is deterministic (arguments are not checked), false 
> otherwise|True if function is deterministic and all operands are constants, 
> false otherwise|
> |CorrelatedVariable|False|False|
> |LocalRef|False|False|
> |Over|False|False|
> |DymanicParameter|False|True|
> |RangeRef|False|False|
> |FieldAccess|False|Given expr.field, true if expr is constant, false 
> otherwise|



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to