Tim Armstrong has uploaded a new patch set (#3). ( 
http://gerrit.cloudera.org:8080/16073 )

Change subject: IMPALA-7020: fix costing of non-trivial CAST expressions
......................................................................

IMPALA-7020: fix costing of non-trivial CAST expressions

Some cast operations are quite expensive to evaluate,
which was not reflected in the uniform costing of CAST
expresions.

We fix this by increasing the cost of non-trivial
casts to be the same as an arbitrary function call.

Testing:
Ran exhaustive tests.

Add planner tests to check that CAST expressions are
materialized or not based on the input and output
types - the planner output lists 'materialized:'
expressions for the SORT operator.

A few existing planner tests had changes in predicate
ordering. I checked manually that these changes made
sense.

Perf:
I sanity-checked that this actually helped (a variant of)
the example query from IMPALA-7020. The following query
went from ~8s to ~2s in my dev environment:

select *
FROM
  (
    SELECT
      o.*,
      ROW_NUMBER() OVER(ORDER BY evt_ts DESC) AS rn
    FROM
      (
        SELECT
          l_orderkey,l_partkey,l_linenumber,l_quantity, cast (l_shipdate as 
date) evt_ts
        FROM
          tpch_parquet.lineitem
      ) o
  ) r
WHERE
  rn BETWEEN 1 AND 101
ORDER BY rn;

Change-Id: I3f1a16fc45191a2eedf38cc243c70173d44806c6
---
M fe/src/main/java/org/apache/impala/analysis/CastExpr.java
M 
testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/min-max-runtime-filters.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/sort-expr-materialization.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/subquery-rewrite.test
5 files changed, 210 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/73/16073/3
--
To view, visit http://gerrit.cloudera.org:8080/16073
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3f1a16fc45191a2eedf38cc243c70173d44806c6
Gerrit-Change-Number: 16073
Gerrit-PatchSet: 3
Gerrit-Owner: Tim Armstrong <tarmstr...@cloudera.com>

Reply via email to