You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Srikanth <sr...@gmail.com> on 2016/02/04 21:54:40 UTC
Re: Broadcast join on multiple dataframes
Hello,
Any pointers on what is causing the optimizer to convert broadcast to
shuffle join?
This join is with a file that is just 4kb in size.
Complete plan -->
https://www.dropbox.com/s/apuomw1dg0t1jtc/plan_with_select.txt?dl=0
DAG from UI -->
https://www.dropbox.com/s/4xc9d0rdkx2fun8/DAG_with_select.PNG?dl=0
== Optimized Logical Plan ==
Project [...]
+- Join LeftOuter, Some((start_ip#48L = start_ip_num#144L))
:- Project [...]
: +- Join Inner, Some((cast(creative_id#9 as bigint) =
creative_id#130L))
: :- Project [...]
: : +- Join Inner, Some((cast(strategy_id#10 as bigint) =
strategy_id#126L))
: : :- Project [...]
: : : +- Join LeftOuter, Some((cast(exchange_id#13 as bigint) =
id#142L))
: : : :- Project [...]
: : : : +- Join LeftOuter, Some((browser_id#59 =
technology_key#169))
: : : : :- Project [...]
: : : : : +- Join LeftOuter,
Some((primary_browser_language#61 = id#166))
: : : : : :- Project [...]
: : : : : : +- Filter ((NOT (campaign_id#12 = 0) &&
(mm_int_cost#36 < 1000000.0)) && ((cost_sum#41 < 1000000.0) &&
(total_spend#42 < 1000000.0)))
: : : : : : +- Relation[...)
: : : : : +- Project [id#166,two_letter_code#167]
: : : : : +- BroadcastHint
: : : : : +- Relation[...
: : : : +- BroadcastHint
: : : : +- Relation[...
: : : +- Project [description#141,id#142L]
: : : +- BroadcastHint
: : : +- Relation[description#141,id#142L,name#143]
JSONRelation
== Physical Plan ==
Project [...]
+- SortMergeOuterJoin [start_ip#48L], [start_ip_num#144L], LeftOuter, None
:- Sort [start_ip#48L ASC], false, 0
: +- TungstenExchange hashpartitioning(start_ip#48L,480), None
: +- Project [...]
: +- BroadcastHashJoin [cast(creative_id#9 as bigint)],
[creative_id#130L], BuildRight
: :- Project [...]
: : +- BroadcastHashJoin [cast(strategy_id#10 as bigint)],
[strategy_id#126L], BuildRight
: : :- Project [...]
: : : +- BroadcastHashOuterJoin [cast(exchange_id#13 as
bigint)], [id#142L], LeftOuter, None
: : : :- Project [...]
: : : : +- BroadcastHashOuterJoin [browser_id#59],
[technology_key#169], LeftOuter, None
: : : : :- Project [...]
: : : : : +- SortMergeOuterJoin
[primary_browser_language#61], [id#166], LeftOuter, None
: : : : : :- Sort [primary_browser_language#61
ASC], false, 0
: : : : : : +- TungstenExchange
hashpartitioning(primary_browser_language#61,480), None
: : : : : : +- Project [...]
: : : : : : +- Filter (((NOT
(campaign_id#12 = 0) && (mm_int_cost#36 < 1000000.0)) && (cost_sum#41 <
1000000.0)) && (total_spend#42 < 1000000.0))
: : : : : : +- Scan
CsvRelation(<function0>,Some(s3://
: : : : : +- Sort [id#166 ASC], false, 0
: : : : : +- TungstenExchange
hashpartitioning(id#166,480), None
: : : : : +- Project
[id#166,two_letter_code#167]
: : : : : +- Scan
CsvRelation(<function0>,Some(s3
: : : : +- ConvertToUnsafe
: : : : +- Scan
CsvRelation(<function0>,Some(s3://
: : : +- Project [description#141,id#142L]
: : : +- Scan
JSONRelation[description#141,id#142L,name#143] InputPaths: s3://
: : +- Project