Skip to main content

Module sql

Module sql 

Source
Expand description

SQL parsing and translation to DataFrame operations. Compiled only when the sql feature is enabled.

Functions§

execute_sql
Parse a SQL string and execute it using the session’s catalog. Supports: SELECT (columns or *), FROM single table or two-table JOIN, WHERE (basic predicates), GROUP BY + aggregates, ORDER BY, LIMIT.
expr_string_to_polars
Parse a single SQL expression string and convert to Polars Expr using the given DataFrame for column resolution. Used by selectExpr/expr() for PySpark parity. Parses “SELECT expr FROM __t” and returns the first select item’s Expr.
parse_sql
Parse a single SQL statement (SELECT or DDL: CREATE SCHEMA / CREATE DATABASE / DROP TABLE).
translate
Translate a parsed Statement (Query or DDL) into a DataFrame using the session catalog. CREATE SCHEMA / CREATE DATABASE return empty DataFrame. DROP TABLE / DROP VIEW remove from session catalog.