e6-spark-compat, followed by end-to-end code samples. For setup, see PySpark compatibility.
DataFrame operations
Transformations are lazy - they build a query plan without executing. Execution is triggered only when an action is called.Transformations
Supported join types:
inner, left, right, full, cross, left_semi, left_anti.
Actions
Actions trigger query execution on e6data and return results.Temporary views
Read formats
Write modes
Usedf.write to save results - .parquet(), .csv(), .partitionBy(...), .insertInto("table"), or .saveAsTable("table").
SQL functions
All functions are imported frome6_spark_compat.sql.functions.
Column references and literals
String functions
upper, lower, trim, ltrim, rtrim, length, substring(col, pos, len), concat(*cols), concat_ws(sep, *cols), split(col, pattern), regexp_extract(col, pattern, idx), regexp_replace(col, pattern, rep), translate, lpad, rpad, repeat, reverse, format_string, format_number.
Math functions
abs, round(col, scale), floor, ceil, sqrt, pow(col, exp), log, log10, exp, sin, cos, tan, asin, acos, atan, atan2, greatest(*cols), least(*cols).
Aggregate functions
count, countDistinct(*cols), sum, avg, min, max, first, last, collect_list, collect_set, stddev, variance, approx_percentile(col, pct).
Date and time functions
Conditional functions
when(condition, value) (chainable with .when(...) / .otherwise(...)), coalesce(*cols), isnull, isnan, if_(condition, true, false).
JSON, array, and other functions
to_json, from_json(col, schema), get_json_object(col, path); explode(col); broadcast(df), cast(col, type).
Window functions are supported via the full Window specification API (partitionBy, orderBy, rowsBetween, rangeBetween) with row_number, rank, lag, lead, and aggregates over a window.
Code samples
Basic analytics pipeline
Window functions: rankings and running totals
Multi-table join
CASE WHEN logic
Spatial analysis: points in polygons
SQL via temp views, and export to Pandas
Writing results
See also
- PySpark compatibility - install and getting started.
- Limitations