[
https://issues.apache.org/jira/browse/HIVE-24638?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jesus Camacho Rodriguez resolved HIVE-24638.
--------------------------------------------
Fix Version/s: 4.0.0
Resolution: Fixed
Pushed to master, thanks [~soumyakanti.das]!
> 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
> Assignee: Soumyakanti Das
> Priority: Major
> Fix For: 4.0.0
>
>
> 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)