[{"data":1,"prerenderedAt":338},["ShallowReactive",2],{"practiceExams":3,"studies":184,"free-lesson-\u002Fcourses\u002Faws-certified-machine-learning-engineer-associate\u002Flessons\u002Famazon-emr-data-transformation-with-apache-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":205,"steps":224,"dateModified":333,"course":334,"nextLesson":335},"amazon-emr-data-transformation-with-apache-spark-mla-c02","Amazon EMR: data transformation with Apache Spark","How Spark jobs on EMR use DataFrame transformations to turn raw data into feature datasets for machine learning.",[190,196,200],{"key":191,"kind":192,"name":193,"icon":194,"provider":195},"amazon-elastic-block-store-(amazon-ebs)","service","Amazon Elastic Block Store (Amazon EBS)","\u002Fimages\u002Fprovider-services\u002Famazon-elastic-block-store-(amazon-ebs)\u002Fcovers\u002FArch_Amazon-Elastic-Block-Store_64.png","AWS",{"key":197,"kind":192,"name":198,"icon":199,"provider":195},"amazon-emr","Amazon EMR","\u002Fimages\u002Fprovider-services\u002Famazon-emr\u002Fcovers\u002FArch_Amazon-EMR_64.png",{"key":201,"kind":202,"name":203,"icon":204,"provider":195},"amazon-s3-bucket","part","Amazon S3 bucket","\u002Fimages\u002Fprovider-services\u002Famazon-s3\u002Fcovers\u002FRes_Amazon-Simple-Storage-Service_Bucket_48.png",[206],{"key":207,"cards":208,"groups":218,"lines":219},"spark-feature-pipeline",[209,212,215],{"key":210,"component":201,"label":211},"raw","Raw transaction files",{"key":213,"component":197,"label":214},"spark","Spark DataFrame job",{"key":216,"component":201,"label":217},"features","Versioned feature dataset",[],[220,222],{"from":210,"to":213,"label":221},"Raw transactions",{"from":213,"to":216,"label":223},"Feature files",[225,246,259,262,275,297,312,315,320],{"kind":226,"title":227,"body":228,"diagram":207,"walkthrough":229},"explanation","From transaction files to model inputs","\u003Cp>\u003Cstrong>Amazon EMR\u003C\u002Fstrong> runs Apache Spark jobs that process data across multiple workers. A Spark \u003Cstrong>DataFrame\u003C\u002Fstrong> represents distributed rows with named, typed columns. You describe operations on those columns rather than writing a loop over every record.\u003C\u002Fp>\u003Cp>Here, raw transactions contain a transaction ID, customer ID, timestamp, and amount. The goal is a \u003Cstrong>feature dataset\u003C\u002Fstrong> with one row per customer and numeric columns such as purchase count and total spending. Preparing these features is separate from training a model.\u003C\u002Fp>\u003Cp>The diagram shows the data flow, not the direction of API requests. \u003Cstrong>Amazon S3\u003C\u002Fstrong> stores the input and output files; the Spark job on EMR performs the computation. The two S3 locations can be separate buckets or separate prefixes in one bucket.\u003C\u002Fp>",[230,233,238,243],{"text":231,"cards":232},"The raw S3 location holds transaction files. These are source records, not yet customer-level features.",[210],{"text":234,"cards":235,"lines":236},"The Spark job on EMR reads the raw transactions into a DataFrame. It cleans records and computes customer-level feature columns.",[213],[237],{"from":210,"to":213},{"text":239,"cards":240,"lines":241},"The job writes feature files to a versioned S3 output location. This makes the prepared dataset available independently of the running job.",[216],[242],{"from":213,"to":216},{"text":244,"cards":245},"The complete flow separates durable raw storage, distributed transformation, and durable feature storage.",[],{"kind":247,"title":248,"exercise":249},"exercise","Follow one batch through the pipeline",{"type":250,"diagram":207,"scenario":251,"path":252},"trace","Follow a batch of raw transactions as it becomes a stored customer-feature dataset.",[253,255,257],{"card":210,"note":254},"Start with the transaction files stored in S3.",{"card":213,"note":256},"Spark reads the records and transforms them into customer features.",{"card":216,"note":258},"The job writes the resulting feature files to S3.",{"kind":226,"title":260,"body":261},"Make the input reliable before calculating features","\u003Cp>Start with an explicit \u003Cstrong>schema\u003C\u002Fstrong>: identifiers as strings, timestamps as timestamps, and amounts as an appropriate numeric type. For CSV or JSON input, supplying a schema avoids relying on inference. Use \u003Ccode>select\u003C\u002Fcode> to keep needed columns and \u003Ccode>withColumn\u003C\u002Fcode> to create or replace a column, including casting text amounts to a numeric type.\u003C\u002Fp>\u003Cp>A cast is not a complete \u003Cstrong>cleaning policy\u003C\u002Fstrong>. Malformed values can cause errors or produce nulls, depending on Spark settings. Decide whether to reject, quarantine, or replace bad values. Use \u003Ccode>filter\u003C\u002Fcode> to retain records meeting your rules, such as non-null customer IDs and valid amounts. Do not replace every missing amount with zero: missing and zero can mean different things.\u003C\u002Fp>\u003Cp>Also define what counts as a \u003Cstrong>duplicate\u003C\u002Fstrong>. If transaction IDs uniquely identify events and repeated records are identical, \u003Ccode>dropDuplicates([\"transaction_id\"])\u003C\u002Fcode> prevents counting an event twice. If duplicate IDs contain conflicting values, define which record wins instead of relying on arbitrary retention.\u003C\u002Fp>",{"kind":247,"title":263,"exercise":264},"Choose the cleaning operations",{"type":265,"question":266,"text":267,"answers":268,"distractors":271},"placeholder","Fill each blank with the DataFrame operation that applies the stated cleaning rule.","After parsing the columns, use {} to keep only rows with valid customer IDs and amounts. For identical repeated events, use {} with transaction_id as the key.",[269,270],"filter","dropDuplicates",[272,273,274],"select","withColumn","join",{"kind":226,"title":276,"body":277,"table":278},"Transform event rows into customer features","\u003Cp>Choose the \u003Cstrong>grain\u003C\u002Fstrong> of the output: what one row represents. Here it is one customer within a defined observation window. After cleaning, \u003Ccode>groupBy(\"customer_id\").agg(count(\"transaction_id\").alias(\"purchase_count\"), sum(\"amount\").alias(\"total_spend\"))\u003C\u002Fcode> produces the two features. The functions \u003Ccode>count\u003C\u002Fcode> and \u003Ccode>sum\u003C\u002Fcode> in this example are imported from \u003Ccode>pyspark.sql.functions\u003C\u002Fcode>.\u003C\u002Fp>\u003Cp>To add customer attributes, use a \u003Cstrong>join\u003C\u002Fstrong> on customer ID. Check that the attribute data has one row per customer before joining; duplicate keys can multiply rows. Grouping and many joins require a \u003Cstrong>shuffle\u003C\u002Fstrong>, moving records between workers. Selecting needed columns and filtering unwanted records early reduces the data later operations must process.\u003C\u002Fp>\u003Cp>DataFrame \u003Cstrong>transformations\u003C\u002Fstrong>, including filtering, grouping, and joining, build a lazy execution plan. They do not by themselves materialize the feature files. An \u003Cstrong>action\u003C\u002Fstrong>, such as writing the result to S3, triggers execution. S3 stores objects; it does not execute this Spark plan.\u003C\u002Fp>",{"columns":279,"rows":283},[280,281,282],"Operation","Purpose","Execution role",[284,288,291,293],[285,286,287],"filter \u002F select","Keep rows \u002F columns","Transformation",[289,290,287],"groupBy().agg()","Compute grouped features",[274,292,287],"Attach related attributes",[294,295,296],"write.parquet()","Persist feature files","Triggers execution",{"kind":247,"title":298,"exercise":299},"Restore the execution stage",{"type":300,"diagram":207,"requirement":301,"change":302,"tray":303,"hint":310,"explanation":311},"flaw","The middle stage must execute the Spark DataFrame plan, aggregate transactions by customer, and write feature files when the write action runs.",{"card":213,"component":201},[304,306,308],{"component":197,"reason":305},"EMR runs the Spark job that executes the transformations and writes the result.",{"component":201,"reason":307},"An S3 bucket stores files; it does not execute Spark DataFrame transformations.",{"component":191,"reason":309},"EBS provides block storage; it does not execute a Spark job.","The storage stages cannot execute the lazy Spark plan. Restore the service that runs Spark.","Amazon EMR runs Spark. The DataFrame transformations describe the work, and the write action triggers execution to produce the S3 feature files.",{"kind":226,"title":313,"body":314},"Write a reusable, trustworthy feature dataset","\u003Cp>Before publishing, validate the \u003Cstrong>feature contract\u003C\u002Fstrong>: expected column names and types, non-null customer keys, and one row per customer for this dataset. Use distributed checks rather than \u003Ccode>collect()\u003C\u002Fcode> on the whole dataset, which brings all rows into the Spark driver and can exhaust its memory.\u003C\u002Fp>\u003Cp>Write the final DataFrame with a call such as \u003Ccode>features.write.mode(\"errorifexists\").parquet(output_path)\u003C\u002Fcode>. \u003Cstrong>Parquet\u003C\u002Fstrong> preserves column types and supports efficient column-oriented reads. Spark normally writes a directory of part files, not one file. Choose a new, versioned S3 path for each published dataset and record the input locations, code version, and observation cutoff so the preparation can be reproduced.\u003C\u002Fp>\u003Cp>For predictive features, use only events available before the \u003Cstrong>prediction cutoff\u003C\u002Fstrong>. Including later transactions leaks future information into training. The full pipeline is therefore more than a file conversion: read typed records, apply cleaning and time rules, aggregate to the required grain, validate, and persist the result.\u003C\u002Fp>",{"kind":247,"title":316,"exercise":317},"Rebuild the complete feature pipeline",{"type":318,"diagram":207,"question":319},"build","Connect the components to show raw transactions becoming validated, customer-level features stored independently of the Spark job.",{"kind":226,"title":321,"body":322,"takeaways":323},"What to remember","\u003Cp>\u003Cstrong>Spark on EMR\u003C\u002Fstrong> turns typed, cleaned source records into validated feature rows through lazy DataFrame transformations and an action that persists the result.\u003C\u002Fp>",[324,327,330],{"title":325,"text":326},"Clean with explicit rules","Define column types, invalid-value handling, and duplicate semantics before calculating features. A successful cast alone does not establish data quality.",{"title":328,"text":329},"Define the feature grain","Aggregate to the intended row meaning and check join-key uniqueness. Use only information available before the prediction cutoff.",{"title":331,"text":332},"Execute and persist","Transformations build a lazy plan; a write action executes it. Publish validated, versioned feature files in S3 so they remain usable after the EMR job finishes.","2026-10-29T23:45:44.132Z",{"pageSlug":117,"code":116,"certification":115,"certificationSlug":117},{"slug":336,"title":337},"broadcast-joins-small-input-replication-in-spark-mla-c02","Broadcast Joins: small-input replication in Spark",1796130181975]