TGViewer
Big Data Science Big Data Science @bdscience · 3.57K subscribers
Post #360 433
💥Python and SQL combo with FugueSQL: a single SQL interface for Pandas, Spark and Dask dateframes
FugueSQL
is an open source Python library that allows you to combine Python code with an SQL command by switching between them in a Jupyter Notebook or Python script. FugueSQL supports distributed computing and provides a unified API to run the same SQL code in Pandas, Dask, and Apache Spark.
Unlike PandaSQL, which has a single SQLite server, which introduces a lot of overhead when transferring data between Pandas and the database, FugueSQL supports multiple local backends: pandas, DuckDB, and SQLite.
When using the pandas backend, Fugue translates SQL directly into pandas operations, excluding data transfers. DuckDB has excellent panda support so the data transfer overhead is negligible. Both Pandas and DuckDB are the preferred FugueSQL server-side modules for local data processing. Fugue also supports Spark, Dask, and cuDF (via blazingSQL) as backends.
The Fugue SQL code is parsed using ANTLR and mapped to equivalent functions in the Fugue API. FugueSQL has many features built in and the code is extensible with Python-code. By default, it supports the most common features of the function: filling in nulls, deleting nulls, renaming columns, changing the schema, and more. Fugue also improves on some improvements in standard SQL to handle end-to-end data workflows gracefully. For example, creating intermediate tables by assigning a number.
As Pandas %% fsql accepts NativeExecutionEngine as a default parameter. In Dask, FugueSQL is slightly slower than the native engine, but more complete in terms of implemented SQL keywords. FugueSQL also runs on Spark, mapping %% fsql operations to Spark and Spark SQL operations. This allows you to quickly develop distributed applications. All you have to do is create a local prototype using the NativeExecutionEngine, test it, and deploy it to the Spark cluster just by changing the execution engine.
https://towardsdatascience.com/introducing-fuguesql-sql-for-pandas-spark-and-dask-dataframes-63d461a16b27
https://fugue-tutorials.readthedocs.io/tutorials/fugue_sql/index.html
Medium Introducing FugueSQL — SQL for Pandas, Spark, and Dask DataFrames An End-To-End SQL Interface for Data Science and Analytics
More from @bdscience
  1. Nov 27, 2025💎 Imagen AI — an intelligent Adobe Lightroom assistant that automates photo editing by le…
  2. Oct 28, 2025🌐 OpenAI has released ChatGPT Atlas Atlas is a browser with an integrated AI sidebar, bui…
  3. Sep 16, 2025🤖 Nanobanana.ai is an AI aggregation platform that provides unified subscription-based ac…
  4. Jul 30, 2025🏀 Photoleap by Lightricks is a premier AI-powered image editing app that seamlessly blend…
  5. Jun 19, 2025⚙️ Rumi Labs transforms passive media into interactive entertainment A San Francisco-based…
  6. May 27, 2025📈Genspark AI: the autonomous super-agent for multi-step business workflows 🧠 Mixture-of-…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →