[{"data":1,"prerenderedAt":303},["ShallowReactive",2],{"practiceExams":3,"studies":184,"free-lesson-\u002Fcourses\u002Faws-certified-machine-learning-engineer-associate\u002Flessons\u002Fbroadcast-joins-small-input-replication-in-spark-mla-c02":185},[4,22,36,48,60,72,84,97,109,120,130,141,154,163,175],{"id":5,"slug":6,"description":7,"questionCount":8,"isActive":9,"datePublicModified":10,"difficulty":11,"examVersion":18},22,"aws-certified-solutions-architect-professional-sap-c03","Prepare for the AWS Certified Solutions Architect - Professional (SAP-C03) exam with realistic practice questions on architecture, security, cost, resilience and automation, with detailed explanations.",767,true,"2026-11-15T00:00:00.000Z",{"providerId":12,"title":13,"subtitle":14,"slug":15,"coverImageUrl":16,"level":17},1,"AWS Certified Solutions Architect - Professional","SAP-C02","aws-certified-solutions-architect-professional","\u002Fimages\u002Fdifficulties\u002Faws-certified-solutions-architect-professionalsap-c02\u002Fcovers\u002Faws-SAP-C02.png","advanced",{"slug":6,"code":19,"dateBetaStart":20,"dateReleased":21,"pageSlug":15},"SAP-C03",null,"2026-11-17",{"id":23,"slug":24,"description":25,"questionCount":26,"isActive":9,"datePublicModified":27,"difficulty":28,"examVersion":34},5,"aws-certified-cloud-practitioner-clf-c02","Master your AWS Certified Cloud Practitioner exam with our Practice Exam Simulator. Prepare effectively and assess your readiness with realistic practice exams designed to mirror the most popular official AWS exam.",937,"2026-10-30T00:00:00.000Z",{"providerId":12,"title":29,"subtitle":30,"slug":31,"coverImageUrl":32,"level":33},"AWS Certified Cloud Practitioner","CLF-C02","aws-certified-cloud-practitioner","\u002Fimages\u002Fdifficulties\u002Faws-certified-cloud-practitionerclf-c02\u002Fcovers\u002Faws-CLF-C02.png","foundational",{"slug":24,"code":30,"dateBetaStart":20,"dateReleased":35,"pageSlug":31},"2023-09-19",{"id":37,"slug":38,"description":39,"questionCount":40,"isActive":9,"datePublicModified":27,"difficulty":41,"examVersion":46},8,"aws-certified-devops-engineer-professional-dop-c02","Boost your readiness for the AWS Certified DevOps Engineer - Professional (DOP-C02) exam with our practice exam simulator. Featuring realistic questions and detailed explanations, it helps you identify knowledge gaps and improve your skills.",1040,{"providerId":12,"title":42,"subtitle":43,"slug":44,"coverImageUrl":45,"level":17},"AWS Certified DevOps Engineer - Professional","DOP-C02","aws-certified-devops-engineer-professional","",{"slug":38,"code":43,"dateBetaStart":20,"dateReleased":47,"pageSlug":44},"2023-03-07",{"id":49,"slug":50,"description":51,"questionCount":52,"isActive":9,"datePublicModified":27,"difficulty":53,"examVersion":57},11,"aws-certified-ai-practitioner-aif-c01","Prepare for the AWS Certified AI Practitioner exam with our practice exam simulator. Realistic questions on AI, machine learning and generative AI fundamentals, with detailed explanations, help you find your knowledge gaps and assess your readiness.",928,{"providerId":12,"title":54,"subtitle":55,"slug":56,"coverImageUrl":45,"level":33},"AWS Certified AI Practitioner","AIF-C01","aws-certified-ai-practitioner",{"slug":50,"code":55,"dateBetaStart":58,"dateReleased":59,"pageSlug":56},"2024-08-13","2024-10-22",{"id":12,"slug":61,"description":62,"questionCount":63,"isActive":9,"datePublicModified":27,"difficulty":64,"examVersion":70},"aws-certified-solutions-architect-associate-saa-c03","Unlock your potential with the AWS Certified Solutions Architect - Associate Practice Exam Simulator. This comprehensive tool is designed to prepare you thoroughly and assess your readiness for the most sought-after AWS associate certification.",1203,{"providerId":12,"title":65,"subtitle":66,"slug":67,"coverImageUrl":68,"level":69},"AWS Certified Solutions Architect - Associate","SAA-C03","aws-certified-solutions-architect-associate","\u002Fimages\u002Fdifficulties\u002Faws-certified-solutions-architect-associatesaa-c03\u002Fcovers\u002Faws-SAA-C03.png","associate",{"slug":61,"code":66,"dateBetaStart":20,"dateReleased":71,"pageSlug":67},"2022-08-30",{"id":73,"slug":74,"description":75,"questionCount":76,"isActive":9,"datePublicModified":27,"difficulty":77,"examVersion":81},9,"aws-certified-data-engineer-associate-dea-c01","Prepare for your AWS Certified Data Engineer - Associate exam with our practice exam simulator. Featuring real exam scenarios, detailed explanations, and instant feedback to boost your confidence and success rate.",891,{"providerId":12,"title":78,"subtitle":79,"slug":80,"coverImageUrl":45,"level":69},"AWS Certified Data Engineer - Associate","DEA-C01","aws-certified-data-engineer-associate",{"slug":74,"code":79,"dateBetaStart":82,"dateReleased":83,"pageSlug":80},"2023-11-27","2024-03-12",{"id":85,"slug":86,"description":87,"questionCount":88,"isActive":9,"datePublicModified":89,"difficulty":90,"examVersion":94},17,"aws-certified-generative-ai-developer-professional-aip-c01","Get ready for the AWS Certified Generative AI Developer - Professional exam with our practice exam simulator. Realistic scenario-based questions with detailed explanations help you assess your readiness to build generative AI solutions on AWS.",982,"2026-10-29T00:00:00.000Z",{"providerId":12,"title":91,"subtitle":92,"slug":93,"coverImageUrl":45,"level":17},"AWS Certified Generative AI Developer - Professional","AIP-C01","aws-certified-generative-ai-developer-professional",{"slug":86,"code":92,"dateBetaStart":95,"dateReleased":96,"pageSlug":93},"2025-11-28","2026-03-17",{"id":98,"slug":99,"description":100,"questionCount":101,"isActive":9,"datePublicModified":89,"difficulty":102,"examVersion":107},13,"aws-certified-security-specialty-scs-c03","Advance your career in cloud security with the AWS Certified Security - Specialty (SCS-C03) Exam Simulator. Realistic, scenario-based practice exams mirror the official exam, with detailed explanations to close your knowledge gaps.",864,{"providerId":12,"title":103,"subtitle":104,"slug":105,"coverImageUrl":106,"level":17},"AWS Certified Security - Specialty","SCS-C03","aws-certified-security-specialty","\u002Fimages\u002Fdifficulties\u002Faws-certified-security-specialtyscs-c02\u002Fcovers\u002Faws_SCS_c02.png",{"slug":99,"code":104,"dateBetaStart":20,"dateReleased":108,"pageSlug":105},"2025-12-01",{"id":110,"slug":111,"description":112,"questionCount":113,"isActive":9,"datePublicModified":89,"difficulty":114,"examVersion":118},19,"aws-certified-machine-learning-engineer-associate-mla-c02","Prepare for the AWS Certified Machine Learning Engineer - Associate exam with our practice exam simulator. Realistic questions with detailed explanations help you find your knowledge gaps and assess your readiness to build and run ML workloads on AWS.",861,{"providerId":12,"title":115,"subtitle":116,"slug":117,"coverImageUrl":45,"level":69},"AWS Certified Machine Learning Engineer - Associate","MLA-C02","aws-certified-machine-learning-engineer-associate",{"slug":111,"code":116,"dateBetaStart":119,"dateReleased":20,"pageSlug":117},"2026-09-29",{"id":121,"slug":122,"description":123,"questionCount":124,"isActive":9,"datePublicModified":89,"difficulty":125,"examVersion":129},15,"aws-certified-ai-business-strategist-aib-c01","Prepare for the AWS Certified AI Business Strategist exam with our practice exam simulator. Realistic, scenario-based questions with detailed explanations help you assess your readiness to lead AI adoption on AWS and close your knowledge gaps.",848,{"providerId":12,"title":126,"subtitle":127,"slug":128,"coverImageUrl":45,"level":33},"AWS Certified AI Business Strategist","AIB-C01","aws-certified-ai-business-strategist",{"slug":122,"code":127,"dateBetaStart":119,"dateReleased":20,"pageSlug":128},{"id":131,"slug":132,"description":133,"questionCount":134,"isActive":9,"datePublicModified":89,"difficulty":135,"examVersion":139},21,"aws-certified-cloudops-engineer-associate-soa-c03","Prepare for the AWS Certified CloudOps Engineer - Associate exam with our practice exam simulator. Realistic questions with detailed explanations help you assess your readiness to deploy, operate and troubleshoot workloads on AWS.",862,{"providerId":12,"title":136,"subtitle":137,"slug":138,"coverImageUrl":45,"level":69},"AWS Certified CloudOps Engineer - Associate","SOA-C03","aws-certified-cloudops-engineer-associate",{"slug":132,"code":137,"dateBetaStart":20,"dateReleased":140,"pageSlug":138},"2025-09-30",{"id":142,"slug":143,"description":144,"questionCount":145,"isActive":9,"datePublicModified":146,"difficulty":147,"examVersion":151},10,"aws-certified-advanced-networking-specialty-ans-c01","The AWS Certified Advanced Networking - Specialty practice exam simulates the real test, offering scenario-based questions that assess your ability to design, implement, and troubleshoot complex AWS networking solutions. ",681,"2024-11-13T00:00:00.000Z",{"providerId":12,"title":148,"subtitle":149,"slug":150,"coverImageUrl":45,"level":17},"AWS Certified Advanced Networking - Specialty","ANS-C01","aws-certified-advanced-networking-specialty",{"slug":143,"code":149,"dateBetaStart":152,"dateReleased":153,"pageSlug":150},"2022-01-01","2022-07-12",{"id":155,"slug":156,"description":157,"questionCount":158,"isActive":9,"datePublicModified":159,"difficulty":160,"examVersion":161},6,"aws-certified-solutions-architect-professional-sap-c02","Elevate your career with the AWS Certified Solutions Architect - Professional Exam Simulator. Get ready to ace the most popular Professional AWS exam with our realistic practice exams. Assess your readiness, boost your confidence, and ensure your success.",789,"2024-06-06T00:00:00.000Z",{"providerId":12,"title":13,"subtitle":14,"slug":15,"coverImageUrl":16,"level":17},{"slug":156,"code":14,"dateBetaStart":20,"dateReleased":162,"pageSlug":20},"2022-11-15",{"id":164,"slug":165,"description":166,"questionCount":167,"isActive":9,"datePublicModified":159,"difficulty":168,"examVersion":173},4,"aws-certified-developer-associate-dva-c02","Unlock your potential as a software developer with the AWS Certified Developer - Associate Exam Simulator! Prepare thoroughly with realistic practice exams designed to mirror the official exam.",399,{"providerId":12,"title":169,"subtitle":170,"slug":171,"coverImageUrl":172,"level":69},"AWS Certified Developer - Associate","DVA-C02","aws-certified-developer-associate","\u002Fimages\u002Fdifficulties\u002Faws-certified-developer-associatedva-c02\u002Fcovers\u002Faws-DVA-C02.png",{"slug":165,"code":170,"dateBetaStart":20,"dateReleased":174,"pageSlug":171},"2023-02-28",{"id":176,"slug":177,"description":178,"questionCount":179,"isActive":9,"datePublicModified":159,"difficulty":180,"examVersion":181},7,"aws-certified-security-specialty-scs-c02","Advance your career in cloud cybersecurity with the AWS Certified Security - Specialty Exam Simulator! Tailored for professionals, this tool offers realistic practice exams to mirror the official exam.",5431,{"providerId":12,"title":103,"subtitle":104,"slug":105,"coverImageUrl":106,"level":17},{"slug":177,"code":182,"dateBetaStart":20,"dateReleased":183,"pageSlug":20},"SCS-C02","2023-07-11",[],{"slug":186,"title":187,"focus":188,"level":69,"components":189,"diagrams":190,"steps":191,"dateModified":298,"course":299,"nextLesson":300},"broadcast-joins-small-input-replication-in-spark-mla-c02","Broadcast Joins: small-input replication in Spark","How replicating a small join input avoids shuffling the larger input, and how to select and verify this strategy using input sizes, worker memory, and Spark execution plans.",[],[],[192,218,235,238,250,253,262,265,285],{"kind":193,"title":194,"body":195,"table":196},"explanation","Move the small input, not the large one","\u003Cp>A join needs matching keys to meet. A \u003Cstrong>shuffle join\u003C\u002Fstrong> can repartition both inputs by the join key, moving rows between workers. A \u003Cstrong>broadcast join\u003C\u002Fstrong> instead replicates one input to the participating executors, the Spark processes that run tasks. Each executor can then join its existing partitions of the other input locally.\u003C\u002Fp>\u003Cp>For a supported equality join, Spark can use a \u003Cstrong>broadcast hash join\u003C\u002Fstrong>. The small input is the \u003Cstrong>build side\u003C\u002Fstrong>: Spark builds an in-memory hash table from it. Tasks scan partitions of the large \u003Cstrong>probe side\u003C\u002Fstrong> and look up matching keys. For example, broadcasting a country-code reference table avoids redistributing a large event dataset by country. Broadcasting still transfers data; it avoids the larger input's join-key shuffle, not every network transfer or every shuffle in the query.\u003C\u002Fp>\u003Cp>This can also avoid concentrating a frequent join key in one shuffled partition. It does \u003Cstrong>not\u003C\u002Fstrong> rebalance partitions that were already oversized or fix skew in a later aggregation. The benefit depends on the large input already having reasonably balanced partitions.\u003C\u002Fp>",{"columns":197,"rows":201},[198,199,200],"Property","Shuffle join","Broadcast hash join",[202,206,210,214],[203,204,205],"Data movement","Repartition by join key","Replicate build input",[207,208,209],"Large input","May move between workers","Probe existing partitions",[211,212,213],"Small input","Partitioned for matching","Complete local lookup",[215,216,217],"Main concern","Shuffle cost and skew","Replicated memory use",{"kind":219,"title":220,"exercise":221},"exercise","Identify what moves",{"type":222,"question":223,"groups":224,"statements":225},"versus","Sort these descriptions by how the join brings matching keys together.",[199,200],[226,229,231,233],{"text":227,"group":228},"Can repartition both inputs by the join key to bring matching rows together.",0,{"text":230,"group":12},"Replicates the complete small build input to participating executors.",{"text":232,"group":12},"Probes a complete copy of the small input while scanning existing large-input partitions, avoiding their join-key shuffle.",{"text":234,"group":228},"Can concentrate a frequent join key in one destination partition by redistributing rows according to that key.",{"kind":193,"title":236,"body":237},"Small means safe in each executor","\u003Cp>Choose a broadcast candidate using the size of the input \u003Cstrong>after filtering and column selection\u003C\u002Fstrong>, not just the original table size. Remove unnecessary rows and columns before joining. A reference table that is much smaller than the event table is promising, but being smaller than the other input is not enough: it must be genuinely small enough to replicate.\u003C\u002Fp>\u003Cp>Check the \u003Cstrong>in-memory representation\u003C\u002Fstrong>. Compressed files can expand when decoded, and the hash table adds overhead. Each receiving executor needs room for the complete build-side representation alongside concurrent tasks, cached data, and other operators. Memory spread across the cluster is not a substitute for enough memory in each executor. Broadcasting also takes distribution and build time, with more recipients increasing aggregate transfer work.\u003C\u002Fp>\u003Cp>Use available statistics and representative execution measurements rather than treating compressed storage size as a memory estimate. Leave \u003Cstrong>memory headroom\u003C\u002Fstrong>; do not allocate all available executor memory to the broadcast. If neither input fits safely, retain an appropriate non-broadcast strategy rather than forcing replication. An oversized broadcast can cause memory exhaustion or broadcast timeouts.\u003C\u002Fp>",{"kind":219,"title":239,"exercise":240},"Use the right memory boundary",{"type":241,"question":242,"text":243,"answers":244,"distractors":247},"placeholder","Fill in the two terms that define a safe broadcast memory check.","Estimate the small input's {} after filtering and column selection. It must fit with headroom in {}, not merely across the cluster.",[245,246],"in-memory hash table","each receiving executor",[248,249],"compressed file size alone","total cluster memory",{"kind":193,"title":251,"body":252},"Let Spark choose, or request a supported broadcast","\u003Cp>Spark can select broadcasting automatically using estimated input sizes and settings such as \u003Ccode>spark.sql.autoBroadcastJoinThreshold\u003C\u002Fcode>. Useful table statistics help the optimizer estimate sizes. The threshold is a \u003Cstrong>planning control\u003C\u002Fstrong>, not proof that the resulting hash table will fit in memory. With \u003Cstrong>Adaptive Query Execution\u003C\u002Fstrong> enabled, Spark can also revise a join strategy using runtime statistics.\u003C\u002Fp>\u003Cp>In PySpark, first prepare the small input, for example \u003Ccode>small = countries.select(\"country_code\", \"country_name\")\u003C\u002Fcode>, adding any required filters. After checking its memory suitability, construct a supported equality join with \u003Ccode>from pyspark.sql.functions import broadcast\u003C\u002Fcode> and \u003Ccode>joined = events.join(broadcast(small), \"country_code\", \"left\")\u003C\u002Fcode>. Here, the right-side reference input is the requested build side. A SQL \u003Ccode>BROADCAST\u003C\u002Fcode> hint is another way to request the strategy.\u003C\u002Fp>\u003Cp>A \u003Cstrong>broadcast request\u003C\u002Fstrong> can bypass the automatic size threshold, so it deserves a memory check rather than blind trust. Join type and condition still constrain eligibility: a hint cannot make every join support broadcast hashing. For a repeatable check, prepare the small input, construct the join from that input, and then inspect \u003Ccode>joined.explain(\"formatted\")\u003C\u002Fcode> before running it.\u003C\u002Fp>",{"kind":219,"title":254,"exercise":255},"Prepare the join before explaining it",{"type":256,"question":257,"steps":258},"process","Put these dependent PySpark steps in order to inspect the planned join.",[259,260,261],"Define small by selecting the required reference columns and applying the required filters.","Define joined by joining events to broadcast(small) on the equality key.","Call joined.explain(\"formatted\") to inspect the physical plan.",{"kind":193,"title":263,"body":264},"Verify the plan and the execution","\u003Cp>In the physical plan, look for \u003Cstrong>BroadcastHashJoin\u003C\u002Fstrong> and identify its build side, often shown as \u003Ccode>BuildRight\u003C\u002Fcode> or \u003Ccode>BuildLeft\u003C\u002Fcode>. Follow that side to \u003Cstrong>BroadcastExchange\u003C\u002Fstrong>, or a reused broadcast exchange, to confirm which input is distributed. For the example, the country reference input should be the build side. Check that the large input is not being repartitioned by the join key for this join; an exchange elsewhere can belong to another operation.\u003C\u002Fp>\u003Cp>A \u003Ccode>BroadcastExchange\u003C\u002Fcode> alone does not prove that Spark used a hash join: broadcast describes distribution, not the matching algorithm. For this equality-join example, confirm \u003Ccode>BroadcastHashJoin\u003C\u002Fcode> as well. If the plan is adaptive, the pre-execution plan may be provisional. After an action executes the query, inspect the \u003Cstrong>final executed plan\u003C\u002Fstrong> in the Spark SQL UI and review broadcast size and time, executor memory pressure, failures, and task behavior.\u003C\u002Fp>\u003Cp>Verification also includes \u003Cstrong>correctness\u003C\u002Fstrong>. Broadcasting does not change join semantics: duplicate reference keys can multiply output rows, and unmatched keys and null handling still matter. Check expected reference-key uniqueness, unmatched records, and output row counts. Accept the strategy when the intended small side is broadcast, memory use is safe, the large-side join shuffle is avoided, and results remain correct—not merely because a hint appears in the code.\u003C\u002Fp>",{"kind":219,"title":266,"exercise":267},"Connect selection with verification",{"type":222,"question":268,"groups":269,"statements":272},"Sort these broadcast-join checks into sound practice and misleading conclusions.",[270,271],"Sound practice","Misleading conclusion",[273,275,277,279,281,283],{"text":274,"group":228},"Check that the filtered reference hash table fits in each receiving executor with headroom.",{"text":276,"group":12},"Treat a small compressed reference file as proof that the broadcast is memory-safe.",{"text":278,"group":228},"Verify BroadcastHashJoin with the reference input as build side and no join-key shuffle of the large input for this join.",{"text":280,"group":12},"Treat a broadcast hint as proof of the strategy used in the final adaptive execution.",{"text":282,"group":228},"Review the final executed plan, runtime memory behavior, and expected output row counts.",{"text":284,"group":12},"Conclude that broadcasting removes duplicate-key row multiplication and fixes later aggregation skew.",{"kind":193,"title":286,"body":287,"takeaways":288},"What to remember","\u003Cp>\u003Cstrong>Broadcast a genuinely small input\u003C\u002Fstrong> to avoid the larger input's join-key shuffle, then verify memory safety, the executed strategy, and result correctness.\u003C\u002Fp>",[289,292,295],{"title":290,"text":291},"Replicate the build side","A broadcast hash join gives participating executors a complete small-side lookup table so tasks can probe it locally. Other operations can still shuffle.",{"title":293,"text":294},"Size per executor","Reduce the small input first and assess its in-memory hash table with headroom for other work. Compressed storage size and total cluster memory are not sufficient checks.",{"title":296,"text":297},"Confirm what ran","Check BroadcastHashJoin, its build side, and the broadcast exchange in the final executed plan. Review runtime behavior and validate keys and output counts.","2026-10-29T23:45:45.068Z",{"pageSlug":117,"code":116,"certification":115,"certificationSlug":117},{"slug":301,"title":302},"amazon-rds-vector-search-with-postgresql-and-pgvector-mla-c02","Amazon RDS: vector search with PostgreSQL and pgvector",1796130182368]