Summary
Full Transcript
#pysparkinterview #pyspark #dataenginnerjobs 🔥 Crack your next PySpark interview with confidence! In this video, we dive into recently asked PySpark interview questions focused on customer analysis. Learn how to work with large datasets, use PySpark transformations, and apply advanced analytical techniques to solve real-world problems. We'll cover: customer first login customer last login customer total login etc. Want more similar videos- hit like, comment, share and subscribe ❤️Do Like, Share and Comment ❤️ ❤️ Like Aim 5000 likes! ❤️ ➖➖➖➖➖➖➖➖➖➖➖➖➖ Please like & share the video. ➖➖➖➖➖➖➖➖➖➖➖➖➖ script from pyspark.sql import SparkSession from pyspark.sql.types import StructType, StructField, StringType, TimestampType schema = ["UserID", "UserName", "Login", "Logout"] # Sample data for users with multiple login/logout sessions data = [ ("U001", "Alice Johnson", "2024-12-15 08:30:00", "2024-12-15 09:30:00"), ("U001", "Alice Johnson", "2024-12-15 10:00:00", "2024-12-15 11:00:00"), ("U002", "Bob Smith", "2024-12-15 09:00:00", "2024-12-15 09:45:00"), ("U002", "Bob Smith", "2024-12-15 10:30:00", "2024-12-15 12:00:00"), ("U002", "Bob Smith", "2024-12-15 13:00:00", "2024-12-15 14:00:00"), ("U003", "Charlie Brown", "2024-12-15 08:45:00", None), ("U003", "Charlie Brown", "2024-12-15 14:00:00", "2024-12-15 15:30:00"), ("U004", "Diana Prince", "2024-12-15 10:00:00", "2024-12-15 11:30:00"), ("U004", "Diana Prince", "2024-12-15 12:00:00", None) ] df=spark.createDataFrame(data,schema) df.show() df.printSchema() ➖➖➖➖➖➖➖➖➖➖➖➖➖ AWS DATA ENGINEER : https://www.youtube.com/playlist?list=PLOlK8ytA0MghpdMjb0m9zu1v9s_qbRP0q Azure data factory : https://youtube.com/playlist?list=PLOlK8ytA0MgguN5XidtQXbILxwCdJCUJE&si=iEICXHP80zGchUYh Azure data engineer playlist : https://youtube.com/playlist?list=PLOlK8ytA0MghBrzu0i6WlTBdoO1WdwV_e SQL PLAYLIST : https://www.youtube.com/playlist?list=PLOlK8ytA0MggGXIKmbfZ-_Xqcos3JKdV- PYSPARK PLAYLIST - https://www.youtube.com/playlist?list=PLOlK8ytA0MgjvOpd-088NRU_vTYw_aryH ➖➖➖➖➖➖➖➖➖➖➖➖➖ 📣Want to connect with me? Check out these links:📣 Join telegram to discuss https://t.me/+Cb98j1_fnZs3OTA1 ➖➖➖➖➖➖➖➖➖➖➖➖➖ what we have covered in this video: ➖➖➖➖➖➖➖➖➖➖➖➖➖ Hope you liked this video and learned something new :) See you in next video, until then Bye-Bye! ➖➖➖➖➖➖➖➖➖➖➖➖➖
