Riza Suminto has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/21504


Change subject: IMPALA-13152: Avoid NaN cost at SortNode.java
......................................................................

IMPALA-13152: Avoid NaN cost at SortNode.java

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 or Infinite
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.
- Pass PlannerTest.testProcessingCost().

Change-Id: Ib49c7ae397dadcb2cb69fde1850d442d33cdf177
---
M fe/src/main/java/org/apache/impala/planner/BaseProcessingCost.java
M fe/src/main/java/org/apache/impala/planner/ProcessingCost.java
M fe/src/main/java/org/apache/impala/planner/SortNode.java
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds-processing-cost.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cpu_cost/tpcds-q43-verbose.test
5 files changed, 115 insertions(+), 29 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/04/21504/1
--
To view, visit http://gerrit.cloudera.org:8080/21504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib49c7ae397dadcb2cb69fde1850d442d33cdf177
Gerrit-Change-Number: 21504
Gerrit-PatchSet: 1
Gerrit-Owner: Riza Suminto <[email protected]>

Reply via email to