Interactive Translation Studio

SQL to PySpark Converter

Paste a SQL query and get clean, readable PySpark code instantly β€” DataFrame API or spark.sql mode. Handles CTEs, JOINs, GROUP BY, HAVING, and more with conversion notes and warnings.

DataFrame API & spark.sql CTEs, JOINs & Aggregations Warnings & Notes Ctrl+Enter to Convert
SQL Query
Favors readable code β€” falls back to spark.sql for complex queries.
PySpark Output
Confidence Waiting for query

Add a SQL statement to inspect the conversion path.

Detected Features 0 clauses

No query analyzed yet.

Source Tables 0 tables

Tables and CTEs appear here after conversion.

Conversion Notes
Notes about aliases, CTE handling, and output strategy will appear here.
Warnings
Complex SQL features that may need manual review will appear here.
How The Tool Thinks
JOIN .join(...)
WHERE .filter(F.expr(...))
GROUP BY .groupBy(...).agg(...)
ORDER BY .orderBy(F.expr(...))
HAVING .filter(...) after .agg()
CTE / Complex spark.sql("""...""")
Comments