Expand description
SQL planning and local execution seam for Krishiv.
This crate owns the DataFusion integration for R1 while keeping DataFusion
out of the long-term public API exposed by krishiv-api.
Re-exports§
pub use cep_sql::MatchRecognizeStatement;pub use cep_sql::execute_streaming_match_recognize;pub use cep_sql::parse_match_recognize;pub use lakehouse::AsOfTableRef;pub use lakehouse::MergeResult;pub use lakehouse::MergeTargetUnsupportedError;pub use lakehouse::preprocess_as_of_sql;pub use grammar::FeatureEntry;pub use grammar::FeatureStatus;pub use grammar::feature_matrix;pub use grammar::features_by_status;pub use grammar::features_for_category;pub use sqlstate::SqlStateError;pub use sqlstate::sqlstate_for;pub use streaming::ContinuousInputError;pub use streaming::ContinuousTableInput;
Modules§
- analyze
- ANALYZE TABLE — collect column statistics from a batch.
- catalog
- Catalog abstractions for Krishiv.
- cep_sql
MATCH_RECOGNIZESQL extension planning and execution (R16 S2).- connector_
table - DataFusion
TableProviderFactoryimplementations backed bykrishiv_connectors::ConnectorRegistry. - create_
function_ ddl - Pre-processor for
CREATE FUNCTION … RETURNS TABLEDDL. - grammar
- SQL grammar and feature matrix for Krishiv.
- incremental_
view CREATE INCREMENTAL VIEWandDECLARE RECURSIVE VIEWSQL extensions.- introspection_
sql DESCRIBE,SHOW COLUMNS, andEXPLAINSQL intercepts.- kafka_
table - lakehouse
- R18 lakehouse SQL extensions: delta/hudi providers, AS OF, MERGE INTO.
- live_
table CREATE LIVE TABLESQL extensions (R14 S1.1).- pipeline_
ddl - Declarative pipeline DDL:
CREATE SOURCE/CREATE SINK/START PIPELINE. - pivot_
sql - E5.4 — PIVOT / UNPIVOT SQL macro rewrite layer.
- recursive_
cte - E5.3 — Recursive CTE: iterative fixpoint execution.
- spark_
sql_ ext - Spark SQL extensions: LATERAL VIEW, TABLESAMPLE, TRANSFORM, DESCRIBE EXTENDED, etc. Spark SQL feature extensions — pre-processors for SQL constructs that DataFusion doesn’t parse natively.
- sqlstate
- SQLSTATE code mapping for Krishiv SQL errors.
- streaming
- streaming_
tvf - Streaming window table-valued functions: TUMBLE, HOP, SESSION.
- streaming_
window_ plan - Compile a windowed streaming SQL query into a
WindowExecutionSpec. - subquery
- E5.1 — Correlated subquery decorrelation: EXISTS/IN/scalar subquery analysis.
- unnest_
sql - E5.2 — LATERAL / UNNEST SQL pre-processing.
Structs§
- CsvReader
Options - Typed options for CSV reads (propagated into DataFusion).
- CsvWriter
Options - Typed options for CSV writes.
- Operation
Registry - Registry of cancelled operation IDs and optional progress snapshots.
- Parquet
Reader Options - Typed options for Parquet reads (propagated into DataFusion).
- Parquet
Writer Options - Typed options for Parquet writes (propagated into the
ArrowWriter). - SqlData
Frame - Krishiv-owned wrapper around a DataFusion DataFrame.
- SqlEngine
- SqlExecution
Stats - Lightweight execution statistics collected from a DataFusion physical plan.
- SqlPlan
- SQL planning output.
- Tagged
Query Result - A query result annotated with the operation ID that produced it.
Enums§
- Grouping
Mode - Engine-agnostic interface over a prepared query result.
- SqlError
- SQL-layer errors.
Traits§
Functions§
- batch_
size_ from_ env - Resolve the batch size from
KRISHIV_BATCH_SIZEenv var. - default_
parallelism_ from_ env - Resolve the default parallelism from
KRISHIV_TARGET_PARALLELISMenv var. - explain_
sql - Create bootstrap
EXPLAINtext for a SQL query. - explain_
sql_ optimized - Explain a SQL query including optimizer rule decisions.
- explain_
sql_ with_ cost - Explain a SQL query and append a cost estimate from the provided cost model.
- parse_
public_ expression - Parse the stable SQL-expression subset into the same engine-owned AST used by Rust and Python.
- plan_
sql - Create a Krishiv logical plan wrapper for a SQL query without executing it.
- pretty_
batches - Format Arrow batches for CLI and tests.
- query_
memory_ limit_ from_ env - Resolve the default per-engine memory limit from the
KRISHIV_QUERY_MEMORY_LIMIT_BYTESenvironment variable. - referenced_
table_ names - Return all base table/relation names referenced by
query. - resolve_
query_ memory_ limit_ bytes - Resolve a per-engine DataFusion memory limit from a raw env var value.
None, unparseable, and zero values all mean “no limit” (the engine runs with DataFusion’s default unbounded pool). - resolve_
streaming_ match_ recognize_ limit - Resolve the streaming MATCH_RECOGNIZE row cap from a raw env var value.
Noneand unparseable values fall back to the documented default of 100_000. Zero is rejected because it would mean “scan zero rows”. - streaming_
match_ recognize_ limit_ from_ env - Resolve the streaming MATCH_RECOGNIZE row cap from the
KRISHIV_MATCH_RECOGNIZE_STREAMING_LIMITenvironment variable.