Hello Aman Sinha, Thomas Tauber-Marshall, Shant Hovsepian, Impala Public 
Jenkins,

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/16073

to look at the new patch set (#5).

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 fe/src/main/java/org/apache/impala/analysis/Expr.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
6 files changed, 212 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/73/16073/5
--
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: 5
Gerrit-Owner: Tim Armstrong <tarmstr...@cloudera.com>
Gerrit-Reviewer: Aman Sinha <amsi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Shant Hovsepian <sh...@cloudera.com>
Gerrit-Reviewer: Thomas Tauber-Marshall <tmarsh...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>

Reply via email to