06 customer who never order
ฝัง
- เผยแพร่เมื่อ 24 ก.ย. 2024
- 🚀 PYSPARK Challenge - Day 6️⃣
🌟PYSPARK Practice/Interview Problem 📊
---------------------------------------------
🎯 PROBLEM STATEMENT
---------------------------------------------
06_Customers Who Never Order
Write a Pyspark program to find all customers who never order anything.
---------------------------------------------
📝 Schema And Data :
---------------------------------------------
Difficult Level : EASY
Input Data :
Define the schema for the "Customers"
customers_schema = StructType([
StructField("id", IntegerType(), True),
StructField("name", StringType(), True)
])
Define data for the "Customers"
customers_data = [
(1, 'Joe'),
(2, 'Henry'),
(3, 'Sam'),
(4, 'Max')
]
Define the schema for the "Orders"
orders_schema = StructType([
StructField("id", IntegerType(), True),
StructField("customerId", IntegerType(), True)
])
Define data for the "Orders"
orders_data = [
(1, 3),
(2, 1)
]
Key Concepts:
📚 What You'll Learn:
✅ DataFrame operations using PySpark
✅ Efficient left anti join for filtering unmatched records
✅ Structuring code for real-world problem-solving scenarios
#dataengineering #pyspark #bigdata #apachespark #learning #dataframes #joinoperations #codingchallenges #leetcode #education #programming #coding #interview