You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Jesus Camacho Rodriguez (Jira)" <ji...@apache.org> on 2021/01/15 00:35:00 UTC

[jira] [Commented] (HIVE-24638) Redundant filter in scalar subquery

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

Jesus Camacho Rodriguez commented on HIVE-24638:
------------------------------------------------

[~vgarg], thoughts? This should not be too difficult, {{sq_count_check }} would return a boolean rather than the value itself? Apparently this has an impact on vectorization ([~mustafaiman] can add further details).

Cc [~scarlin]

> Redundant filter in scalar subquery 
> ------------------------------------
>
>                 Key: HIVE-24638
>                 URL: https://issues.apache.org/jira/browse/HIVE-24638
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Mustafa İman
>            Priority: Major
>
> Look at the query and CBO plan in https://issues.apache.org/jira/browse/HIVE-24595 .
> Note that there is a filter to guarantee that subquery returns only one row: "HiveFilter(condition=[<=(sq_count_check($0), 1)])" . This condition is redundant as either sq_count_check fails in runtime or condition is true for all rows.
> Look at the stacktrace
> {code:java}
>  at org.apache.hadoop.hive.ql.udf.generic.GenericUDFSQCountCheck.evaluate(GenericUDFSQCountCheck.java:70) at org.apache.hadoop.hive.ql.udf.generic.GenericUDFSQCountCheck.evaluate(GenericUDFSQCountCheck.java:70) at org.apache.hadoop.hive.ql.exec.ExprNodeGenericFuncEvaluator._evaluate(ExprNodeGenericFuncEvaluator.java:197) at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:80) at org.apache.hadoop.hive.ql.exec.ExprNodeGenericFuncEvaluator$DeferredExprObject.get(ExprNodeGenericFuncEvaluator.java:88) at org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPEqualOrLessThan.evaluate(GenericUDFOPEqualOrLessThan.java:111) at org.apache.hadoop.hive.ql.exec.ExprNodeGenericFuncEvaluator._evaluate(ExprNodeGenericFuncEvaluator.java:197) at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:80) at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:68) at org.apache.hadoop.hive.ql.exec.FilterOperator.process(FilterOperator.java:113) at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:888) at org.apache.hadoop.hive.ql.exec.GroupByOperator.forward(GroupByOperator.java:1004) at org.apache.hadoop.hive.ql.exec.GroupByOperator.flush(GroupByOperator.java:1028)
> {code}
> GenericUDFOPEqualOrLessThan is redundant here as GenericUDFSQCountCheck does the same check.
>  
>  
>  
>  



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