Making PySpark code faster with DuckDB
MotherDuck
@motherduckdbAbout
Collaborative serverless analytics platform
Latest Posts
Video Description
In this video @mehdio dives into the new experimental feature of DuckDB : running PySpark code but with DuckDB engine ⚡ Note : This is not yet supported on MotherDuck ☁️🦆 Start using DuckDB in the Cloud for FREE with MotherDuck : https://hubs.la/Q02QnFR40 📓 Resources * Github Repo of the tutorial : https://github.com/mehd-io/duckdb-pyspark-demo * Niels Claes's benchmark on SQL engines : https://medium.com/datamindedbe/head-to-head-comparison-of-dbt-sql-engines-497d71535881 ➡️ Follow Us LinkedIn: http://linkedin.com/company/motherduck X (formerly known as Twitter) : https://twitter.com/motherduck Blog: https://motherduck.com/blog/ 0:00 Intro 0:53 Challenges of Apache Spark development 3:24 The Java boat load 6:01 Pyspark with DuckDB demo 8:10 A word about benchmarks 8:50 Limitations 9:26 Conclusions #duckdb #pyspark #apachespark #dataengineering -------------------------------------- While Apache Spark revolutionized data pipelines, its cluster-first architecture creates overhead for modern development. This video explores a game-changing alternative: using DuckDB's experimental PySpark API compatibility. Learn how to run your existing PySpark code with the lightweight power of DuckDB under the hood, providing a faster, more efficient solution for data processing on today's powerful single machines and simplifying your developer workflow. We break down the common challenges of developing with Apache Spark for small to medium data. Spark's design introduces significant overhead for local development, CI pipelines, and incremental jobs. We examine how serverless Spark offerings from cloud providers often enforce a minimal two-node cluster, leading to higher costs and slow startup times for small jobs. This makes a lightweight, resource-efficient setup a critical need for many data engineering tasks. Discover how DuckDB's PySpark API offers a powerful solution. By replacing the JVM with DuckDB's native engine, you can dramatically shrink your container image size, leading to faster CI builds and quicker local iterations. Our hands-on demo walks you through running the same PySpark script against both pure PySpark and DuckDB with a simple import switch, showcasing significant performance gains and a more streamlined development workflow without the JVM's cold start delay. Although the PySpark API in DuckDB is still experimental, it’s already a valuable tool for accelerating your development process. We show how you can use it today to speed up unit testing for Spark jobs by leveraging DuckDB for fast in-memory transformations. This feature marks a significant milestone as the first Python code in DuckDB, making community contributions easier than ever. We'll show you where to find the code and how you can help expand this powerful new capability.
You May Also Like
Essential iPhone 13 Accessories
AI-recommended products based on this video
![iPhone Charger Cord [MFi Certified] 3Pack 0.9M Lighting Cable Power Delivery Charging Cord Compatible with iPhone 14 13 13 Pro Max 12 12 Pro Max 11 XS XR X 8 iPad,White](https://m.media-amazon.com/images/I/61i3XjcGu1L._AC_SL1500_.jpg)
iPhone Charger Cord [MFi Certified] 3Pack 0.9M Lighting Cable Power Delivery Charging Cord Compatible with iPhone 14 13 13 Pro Max 12 12 Pro Max 11 XS XR X 8 iPad,White

Kaistyle for Magsafe Car Mount【20 Strong Magnets】 Magnetic Phone Holder for Car Phone Holder Mount Dash Cell Phone Holders for Your Car Accessories for Women Men for iPhone 17 Pro Max 16 15 14 13 12 ClimatePartner certified
![Car Phone Holder for Magsafe [78+LBS Strongest Suction & 2400gf Magnetic] 360° Adjustable Car Phone Mount, Phone Holders for Your Car for iPhone 17 Pro Max 16 15 14 13 12 Air Plus (Carbon Fiber) Global Recycled Standard](https://m.media-amazon.com/images/I/712lUnThXpL._AC_UL960_FMwebp_QL65_.jpg)
Car Phone Holder for Magsafe [78+LBS Strongest Suction & 2400gf Magnetic] 360° Adjustable Car Phone Mount, Phone Holders for Your Car for iPhone 17 Pro Max 16 15 14 13 12 Air Plus (Carbon Fiber) Global Recycled Standard

LISEN Retractable Car Charger, 69W USB C Car Accessories Adapter for iPhone 17 USB C Charger Fast Charging, Gifts for Women Men, Travel Essentials, for iPhone 17 Pro Max Air 16 15 14 13 12 Samsung S25

Belkin BoostCharge Lightning Cable - 6.6ft/2M - MFi Certified Apple iPhone Charger USB to Lightning Cable - iPhone Cable - iPhone Charger Cord - Apple Charger - USB Phone Charger - Black

Apple 20W USB-C Compact Power Adapter: Fast and Convenient Charging, Type C Wall Charger

Temdan for Travel Essentials,3 in 2 USB C Cable for Apple Watch Charger/iPhone 16 Charger/Lightning,Multi Charging Cable Cord,Camping Essentials,Portable Designed for iWatch Series &iPhone 16-12-4FT Global Recycled Standard

Soundcore by Anker P20i True Wireless Earbuds, 10mm Drivers with Big Bass, Bluetooth 5.3, 30H Long Playtime, Water-Resistant, 2 Mics for AI Clear Calls, 22 Preset EQs, Customization (Blue)

Anker iPhone 16 Charger, 2-Pack 20W Fast USB C Charger Block, for iPhone 16/16 Pro Max/15 Series/iPad Pro and More (White, 2 Pack & 2 Cable)

Soundcore Liberty 4 Pro by Anker, Noise Cancelling Wireless Earbuds, 7-Sensor and Real-Time Adaptive Noise Cancelling, 2× Faster Charging, Studio-Level Hi-Fi Music, Clear Calls with 6 Mics and AI

Soundcore by Anker Liberty 4 NC Wireless Earbuds, 98.5% Noise Reduction, Adaptive Noise Cancelling to Ears and Environment, Hi-Res Sound, 50H Battery, Wireless Charging, Bluetooth 5.3

amFilm Tempered Glass Screen Protector Compatible with Nintendo Switch 2 7.9" 2025 Alignment Installation Frame Transparent HD Clear Case Accessories Anti-Scratch (3-Pack) (SWTCH2-7.9")

daydayup Switch Case and Tempered Glass Screen Protector Compatible with Nintendo Switch - Deluxe Hard Shell Travel Carrying Case, Pouch for Nintendo Switch Console & Accessories, Streak Red

JSAUX 3-Pack Tempered Glass Screen Protector for Nintendo Switch 2 (2025), Easy to Install with Guiding Frame Ultra HD Glass Protector 9H Hardness Scratch Resistant Accessories for Switch2
![ivoler 4-Pack Tempered Glass Screen Protector Designed for Nintendo Switch 2 2025 with [Alignment Frame] Transparent HD Clear[Updated Version] Screen Protector for Switch 2 7.9'' Global Recycled Standard ClimatePartner certified](https://m.media-amazon.com/images/I/71W72WVMW7L._AC_UY654_FMwebp_QL65_.jpg)
ivoler 4-Pack Tempered Glass Screen Protector Designed for Nintendo Switch 2 2025 with [Alignment Frame] Transparent HD Clear[Updated Version] Screen Protector for Switch 2 7.9'' Global Recycled Standard ClimatePartner certified

ANKER 737 Power Bank, 24,000mAh 3-Port Laptop Portable Charger with 140W Fast Charging, Smart Display, for Outdoor Work, Compatible with iPhone 16/15/14 Series, Vision Pro, Samsung, MacBook, and More

Anker iPhone 16 Charger, 2-Pack 20W Fast USB C Charger Block, for iPhone 16/16 Pro Max/15 Series/iPad Pro and More (White, 2 Pack & 2 Cable)

Apple AirPods Pro 2 Wireless Earbuds, Active Noise Cancellation, Hearing Aid Feature, Bluetooth Headphones, Transparency, Personalized Spatial Audio, High-Fidelity Sound, H2 Chip, USB-C Charging

Soundcore by Anker Liberty 4 NC Wireless Earbuds, 98.5% Noise Reduction, Adaptive Noise Cancelling to Ears and Environment, Hi-Res Sound, 50H Battery, Wireless Charging, Bluetooth 5.3

Soundcore Liberty 4 Pro by Anker, Noise Cancelling Wireless Earbuds, 7-Sensor and Real-Time Adaptive Noise Cancelling, 2× Faster Charging, Studio-Level Hi-Fi Music, Clear Calls with 6 Mics and AI

ESR 3 Pack for iPhone 16e/ iPhone 14/ iPhone 13/ iPhone 13 Pro Privacy Screen Protector, Anti-spy Tempered-Glass Privacy Screen Protector, Micro-curved Edges, Case Friendly
![iPhone Charger Cord [MFi Certified] 3Pack 0.9M Lighting Cable Power Delivery Charging Cord Compatible with iPhone 14 13 13 Pro Max 12 12 Pro Max 11 XS XR X 8 iPad,White](https://m.media-amazon.com/images/I/61i3XjcGu1L._AC_SL1500_.jpg)
iPhone Charger Cord [MFi Certified] 3Pack 0.9M Lighting Cable Power Delivery Charging Cord Compatible with iPhone 14 13 13 Pro Max 12 12 Pro Max 11 XS XR X 8 iPad,White

VOLTME Portable Charger, Slim 10000mAh 5V/3A Power Bank, USB C in&Out High-Speed Charging Battery Pack, Travel Essentials Dual Output Compatible with iPhone 16 15 14 13 12 Samsung Google iPad etc

Kaistyle for Magsafe Car Mount【20 Strong Magnets】 Magnetic Phone Holder for Car Phone Holder Mount Dash Cell Phone Holders for Your Car Accessories for Women Men for iPhone 17 Pro Max 16 15 14 13 12 ClimatePartner certified

Anker USB C to USB C Cable, Type-C 60W Fast Charging Cable (6FT, 2Pack) for iPhone 16 Series, iPad mini 6 and More (Black) ClimatePartner certified

VOLTME Portable Charger, Slim 10000mAh 5V/3A Power Bank, USB C in&Out High-Speed Charging Battery Pack, Travel Essentials Dual Output Compatible with iPhone 16 15 14 13 12 Samsung Google iPad etc

VEEKTOMX Portable Charger with Built in Cables 10000mAh, Power Bank for iPhone with Wall Plug, Travel Essential Fast Charging USB C Slim External Battery Pack for iPhone16/15/14, Samsung, iPad, etc









