SQL / DataFrame Coverage#

This page summarises which operations are supported across the three input paths — direct SQL strings, pandas-inspired DataFrame tracing, and polars LazyFrame — when converting tabular data manipulations to ONNX.

SQL string coverage#

The following SQL constructs are handled by sql_to_onnx():

SQL construct

Status

Notes

SELECT col

✔ supported

column pass-through via Identity

SELECT expr AS alias

✔ supported

arithmetic: Add, Sub, Mul, Div

SELECT AGG(col)

✔ supported

SUM, AVG, MIN, MAX, COUNT

WHERE condition

✔ supported

comparisons + AND / OR

GROUP BY cols

⚠ partial

per-group aggregation via Unique + ScatterElements; multi-column keys cast to float64 (precision loss for integers > 2**53)

[INNER|LEFT|RIGHT|FULL] JOIN ON col = col

✔ supported

equi-join on a single key column; multiple JOINs supported

SELECT DISTINCT

✘ not supported

parsed but raises NotImplementedError

HAVING

✘ not supported

not yet implemented

ORDER BY

✘ not supported

not yet implemented

LIMIT

✘ not supported

not yet implemented

Subqueries

✔ supported

inner query outputs become outer query columns

String equality (WHERE col = 'val')

✘ not supported

requires special ONNX string handling

DataFrame tracer coverage#

The following TracedDataFrame and TracedSeries operations are handled by dataframe_to_onnx():

Operation

Status

Notes

df["col"]

✔ supported

column access

df.filter(condition)

✔ supported

maps to WHERE

df.select([series, …])

✔ supported

maps to SELECT

df.assign(name=series)

✔ supported

maps to SELECT AS name

df.groupby(cols)

⚠ partial

per-group aggregation supported; multi-column keys cast to float64

Series arithmetic (+, -, *, /)

✔ supported

Add, Sub, Mul, Div

Series comparisons (>, <, >=, <=, ==, !=)

✔ supported

Greater, Less, Equal, …

.sum() / .mean() / .min() / .max() / .count()

✔ supported

ReduceSum, ReduceMean, ReduceMin, ReduceMax

cond1 & cond2 / cond1 | cond2

✔ supported

And, Or

series.alias("name")

✔ supported

output rename

df.join(right, left_key, right_key)

✔ supported

equi-join; inner (default), left, right, full

df.pivot_table(values, index, columns, aggfunc)

✔ supported

requires explicit column_values; sum, mean, min, max, count

Conditional branches (if/else)

✘ not supported

tracing captures one execution path only

Polars LazyFrame coverage#

The following polars operations are handled by lazyframe_to_onnx():

Polars operation

Status

Notes

lf.select([…])

✔ supported

column selection and arithmetic expressions

lf.filter(condition)

✔ supported

comparison and boolean predicates

lf.group_by(cols).agg([…])

⚠ partial

whole-dataset aggregation only

Arithmetic (+, -, *, /)

✔ supported

inlined into SELECT expressions

Comparisons (>, <, >=, <=, ==, !=)

✔ supported

WHERE predicates

& / | compound predicates

✔ supported

AND / OR in WHERE

.alias("name")

✔ supported

output rename

Aggregation methods (.sum(), .mean(), .min(), .max(), .count())

✔ supported

ReduceSum, ReduceMean, ReduceMin, ReduceMax

lf.join(…)

✘ not supported

not yet implemented

lf.sort(…)

✘ not supported

not yet implemented

lf.limit(…) / lf.head(…)

✘ not supported

not yet implemented

lf.unique(…)

✘ not supported

not yet implemented

Further reading#