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 2021/01/07 02:16:00 UTC

[jira] [Commented] (IMPALA-10412) ConvertToCNFRule can be apply to view table

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

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

Commit 200d3664f0117e1f7a9b01941d004189d4343920 in impala's branch refs/heads/master from gaoxiaoqing
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=200d366 ]

IMPALA-10412: ConvertToCNFRule can be applied to view table

For OR predicates that reference a view, currently the ConvertToCNFRule
does not get applied since it is considered a single table predicate
even if the predicate might reference columns from different tables
within the view. This patch enables the application of this rule for
such predicates by checking the expanded view and if it satisfies the
criterion then the rule can be applied and the predicate can be pushed
eventually to the scan.

Testing:
Added planner test in inline-view.test

Change-Id: Ie7a9a215d6b92aec07153e643268370f34186c88
Reviewed-on: http://gerrit.cloudera.org:8080/16912
Reviewed-by: Aman Sinha <am...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> ConvertToCNFRule can be apply to view table
> -------------------------------------------
>
>                 Key: IMPALA-10412
>                 URL: https://issues.apache.org/jira/browse/IMPALA-10412
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Frontend
>    Affects Versions: Impala 4.0
>            Reporter: gaoxiaoqing
>            Assignee: gaoxiaoqing
>            Priority: Minor
>             Fix For: Impala 4.0
>
>
> ConvertToCNFRule can be apply to view table, if the predicate associated more than one tuples and the predicate can be pushed down to scan node.
> e.g.
> {code:java}
> CREATE VIEW rawdata.test_cnf AS
> SELECT
> -- +straight_join
>  events.*, users.p_channel p_channel_profile FROM rawdata.event_ros_p7 events LEFT OUTER JOIN
> -- +BROADCAST
>  rawdata.profile_wos_p7 users ON events.user_id = users.id
> {code}
>  
> {code:java}
> select event_id, p_query from test_cnf where p_query='a' or (p_package_id='b' and p_channel_profile='c');
> {code}
>  
> the optimized plan
> {code:java}
> PLAN-ROOT SINK
> |
> 04:EXCHANGE [UNPARTITIONED]
> |
> 02:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
> |  hash predicates: events.user_id = users.id
> |  other predicates: events.p_query = 'a' OR users.p_channel = 'c'
> |  row-size=79B cardinality=6.31M
> |
> |--03:EXCHANGE [BROADCAST]
> |  |
> |  01:SCAN KUDU [rawdata.profile_wos_p7 users]
> |     row-size=35B cardinality=151.23M
> |
> 00:SCAN HDFS [rawdata.event_ros_p7 events]
>    partitions=21/23 files=1410 size=10.99GB
>    predicates: events.p_query = 'a' OR events.p_package_id = 'b'
>    row-size=44B cardinality=6.31M
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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