input.
SQL dialect
Custom SQL uses PostgreSQL-compatible syntax. Standard SQL features are fully supported:- Common table expressions (CTEs) with
WITH - Window functions (
ROW_NUMBER,RANK,LAG,LEAD, etc.) JOIN/LEFT JOIN/CROSS JOINUNION ALL/INTERSECT/EXCEPT- Subqueries (scalar,
IN,EXISTS) CASE WHEN/COALESCE/NULLIFFILTERclause on aggregates- Type casting with
CAST(),TRY_CAST(), and::syntax INTERVALarithmetic- Boolean expressions and
IS [NOT] NULL
Function reference
Aggregate functions
Aggregate functions
String functions
String functions
Date and time functions
Date and time functions
Window functions
Window functions
Type and conditional functions
Type and conditional functions
Math functions
Math functions
Common patterns
Deduplicate rows
Keep only the latest record per key:Running total
Pivot with CASE WHEN
PIVOT syntax is not supported. Use CASE WHEN instead:
Unpivot with UNION ALL
UNPIVOT syntax is not supported. Use UNION ALL instead:
Conditional aggregation with FILTER
Gap detection
Execution engines
Each Custom SQL node can run on a different engine. Choose the best one for your workload:
Set the default engine in Settings → Compute. Override per-node using the engine selector dropdown in the Custom SQL configuration panel.
Use the Execution Plan preview to see which engine each node will use before running the pipeline.
AI assistance
The AI Copilot can generate Custom SQL from natural language descriptions. Open the prompt box in the Custom SQL editor and describe what you need. Copilot generates PostgreSQL-compatible SQL targeting the DataFusion engine. Use Check with AI to validate your SQL for syntax errors, type mismatches, and performance suggestions.Related topics
Advanced nodes
All advanced node types including Python and Notebooks.
SQL assistance
AI-powered SQL generation and optimization.
Pipeline troubleshooting
Common errors and debugging steps.
Compute settings
Configure default SQL engine and thresholds.