[
https://issues.apache.org/jira/browse/IMPALA-10320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17231138#comment-17231138
]
ASF subversion and git services commented on IMPALA-10320:
----------------------------------------------------------
Commit 5a00a4c06f8ec40a8867dcbc036cf5bb47b8a3be in impala's branch
refs/heads/master from Shant Hovsepian
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=5a00a4c ]
IMPALA-10320: Specify expression selectivity for BoolLiteral.
Setting the selectivity of true and false literals to 1 and 0
respectively.
Also setting a NullLiteral's selectivity to 0.
Testing:
- New tests in ExprCardinalityTest
Change-Id: I999942c96cd685f22d8634509d9f488f2a1f82b8
Reviewed-on: http://gerrit.cloudera.org:8080/16714
Tested-by: Impala Public Jenkins <[email protected]>
Reviewed-by: Tim Armstrong <[email protected]>
> Set selectivity of BooleanLiteral
> ---------------------------------
>
> Key: IMPALA-10320
> URL: https://issues.apache.org/jira/browse/IMPALA-10320
> Project: IMPALA
> Issue Type: Improvement
> Components: Frontend
> Affects Versions: Impala 3.4.0
> Reporter: Shant Hovsepian
> Assignee: Shant Hovsepian
> Priority: Major
>
> The selectivity for BooleanLiterals is not current set. In most cases
> predicates containing boolean literals are either rare or optimized away.
> However certain statement rewrites will insert boolean literals when
> modifying or removed a predicate that is no longer relevant, with more
> complex predicates and in particular disjunctive predicates these boolean
> literals can't be optimized away.
> Simply a true literal should have selectivity of 1 and false of 0.
>
> For example the cardinality below should in fact be closer to 7,300 instead
> of assuming the default selectivity of 0.1 hence 730.
> {noformat}
> Query: explain select id from alltypes where int_col != 1 or true
> +-------------------------------------------------------------+
> | Explain String |
> +-------------------------------------------------------------+
> | Max Per-Host Resource Reservation: Memory=32.00KB Threads=3 |
> | Per-Host Resource Estimates: Memory=160MB |
> | Codegen disabled by planner |
> | |
> | PLAN-ROOT SINK |
> | | |
> | 01:EXCHANGE [UNPARTITIONED] |
> | | |
> | 00:SCAN HDFS [functional.alltypes] |
> | HDFS partitions=24/24 files=24 size=478.45KB |
> | predicates: TRUE OR int_col != 1 |
> | row-size=8B cardinality=730 |
> +-------------------------------------------------------------+{noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]