Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
Impala 4.0.0
-
None
-
ghx-label-12
Description
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.
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
select event_id, p_query from test_cnf where p_query='a' or (p_package_id='b' and p_channel_profile='c');
the optimized plan
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