SQL Overview
Krishiv SQL surface: DataFusion base plus Krishiv extensions.
Overview
Krishiv SQL is built on DataFusion, which implements a broad subset of ANSI SQL. Krishiv adds extensions for streaming, incremental views, live tables, pipeline DDL, lakehouse DML, pattern matching, and session management.
Standard SQL (DataFusion)
All standard SELECT semantics are supported: projections, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET, CTEs (WITH), subqueries, UNNEST, window functions (ROW_NUMBER, RANK, LAG, LEAD, etc.), UNION / INTERSECT / EXCEPT, JOINs, string/date/numeric/aggregate/array functions, CASE expressions, CAST, COALESCE, and NULLIF.
Krishiv SQL Extensions
| Extension | Status | Summary |
|---|---|---|
Window functions: tumble_start / tumble_end / hop_start / hop_end | Available | Temporal bucket helpers for streaming GROUP BY. |
MATCH_RECOGNIZE | Available | Complex Event Processing (CEP) pattern matching. |
MERGE INTO | Preview | Upsert/delete on Iceberg tables. |
DELETE FROM <iceberg-table> | Preview | Copy-on-write row delete on Iceberg. |
UPDATE <iceberg-table> | Preview | Copy-on-write row update on Iceberg. |
CREATE INCREMENTAL VIEW | Experimental | Register an incrementally maintained view. |
REFRESH / DROP INCREMENTAL VIEW | Experimental | Lifecycle DDL for incremental views. |
CREATE LIVE TABLE | Experimental | Register a live-ingestion table. |
REFRESH / DROP LIVE TABLE | Experimental | Lifecycle DDL for live tables. |
CREATE SOURCE / CREATE SINK | Experimental | Pipeline DDL for named sources and sinks. |
START PIPELINE | Experimental | Start a named pipeline from registered source/sink. |
CREATE EXTERNAL TABLE … STORED AS KAFKA | Preview | Register a Kafka topic as a streaming table. |
<table> FOR SYSTEM_TIME AS OF <expr> | Preview | Time-travel read on Iceberg tables. |
CREATE FUNCTION … RETURNS TABLE LANGUAGE SQL | Available | SQL-body table-valued functions. |
SET shuffle.partitions = N | Available | Override shuffle bucket count for this session. |
DESCRIBE <table> | Available | Return schema of a registered table. |
EXPLAIN [VERBOSE] <query> | Available | Show DataFusion logical/physical plan. |
CALL system.<proc>(...) | Preview | Iceberg maintenance procedures (expire_snapshots, rewrite_data_files, etc.). |
Error Handling
SQL errors are returned as typed SqlError values: EmptyQuery, EmptyTableName, Unsupported, DataFusion, Optimizer, AccessDenied, OperationCancelled, Timeout.