You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2024/08/13 21:50:00 UTC

[jira] [Commented] (IMPALA-13152) IllegalStateException in computing processing cost when there are predicates on analytic output columns

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

ASF subversion and git services commented on IMPALA-13152:
----------------------------------------------------------

Commit 5bf979d03bf131de86cca5f979e9d88d3240305f in impala's branch refs/heads/branch-4.4.1 from Riza Suminto
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=5bf979d03 ]

IMPALA-13152: Avoid NaN, infinite, and negative ProcessingCost

TOP-N cost will turn into NaN if inputCardinality is equal to 0 due to
Math.log(inputCardinality). This patch fix the issue by avoiding
Math.log(0) and replace it with 0 instead.

After this patch, Instantiating BaseProcessingCost with NaN, infinite,
or negative totalCost will throw IllegalArgumentException. In
BaseProcessingCost.getDetails(), "total-cost" is renamed to "raw-cost"
to avoid confusion with "cost-total" in ProcessingCost.getDetails().

Testing:
- Add testcase that run TOP-N query over empty table.
- Compute ProcessingCost in most FE and EE test even when
  COMPUTE_PROCESSING_COST option is not enabled by checking if
  RuntimeEnv.INSTANCE.isTestEnv() is True or TEST_REPLAN option is
  enabled.
- Pass core test.

Change-Id: Ib49c7ae397dadcb2cb69fde1850d442d33cdf177
Reviewed-on: http://gerrit.cloudera.org:8080/21504
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> IllegalStateException in computing processing cost when there are predicates on analytic output columns
> -------------------------------------------------------------------------------------------------------
>
>                 Key: IMPALA-13152
>                 URL: https://issues.apache.org/jira/browse/IMPALA-13152
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>            Reporter: Quanlong Huang
>            Assignee: Riza Suminto
>            Priority: Major
>             Fix For: Impala 4.5.0
>
>
> Saw an error in the following query when is on:
> {code:sql}
> create table tbl (a int, b int, c int);
> set COMPUTE_PROCESSING_COST=1;
> explain select a, b from (
>   select a, b, c,
>     row_number() over(partition by a order by b desc) as latest
>   from tbl
> )b
> WHERE latest=1
> ERROR: IllegalStateException: Processing cost of PlanNode 01:TOP-N is invalid!
> {code}
> Exception in the logs:
> {noformat}
> I0611 13:04:37.192874 28004 jni-util.cc:321] 264ee79bfb6ac031:42f8006c00000000] java.lang.IllegalStateException: Processing cost of PlanNode 01:TOP-N is invalid!
>         at com.google.common.base.Preconditions.checkState(Preconditions.java:512)
>         at org.apache.impala.planner.PlanNode.computeRowConsumptionAndProductionToCost(PlanNode.java:1047)
>         at org.apache.impala.planner.PlanFragment.computeCostingSegment(PlanFragment.java:287)
>         at org.apache.impala.planner.Planner.computeProcessingCost(Planner.java:560)
>         at org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1932)
>         at org.apache.impala.service.Frontend.getPlannedExecRequest(Frontend.java:2892)
>         at org.apache.impala.service.Frontend.doCreateExecRequest(Frontend.java:2676)
>         at org.apache.impala.service.Frontend.getTExecRequest(Frontend.java:2224)
>         at org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1985)
>         at org.apache.impala.service.JniFrontend.createExecRequest(JniFrontend.java:175){noformat}
> Don't see the error if removing the predicate "latest=1".



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org