Skip to main content

Crate krishiv_sql

Crate krishiv_sql 

Source
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_RECOGNIZE SQL extension planning and execution (R16 S2).
connector_table
DataFusion TableProviderFactory implementations backed by krishiv_connectors::ConnectorRegistry.
create_function_ddl
Pre-processor for CREATE FUNCTION … RETURNS TABLE DDL.
grammar
SQL grammar and feature matrix for Krishiv.
incremental_view
CREATE INCREMENTAL VIEW and DECLARE RECURSIVE VIEW SQL extensions.
introspection_sql
DESCRIBE, SHOW COLUMNS, and EXPLAIN SQL intercepts.
kafka_table
lakehouse
R18 lakehouse SQL extensions: delta/hudi providers, AS OF, MERGE INTO.
live_table
CREATE LIVE TABLE SQL 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§

CsvReaderOptions
Typed options for CSV reads (propagated into DataFusion).
CsvWriterOptions
Typed options for CSV writes.
OperationRegistry
Registry of cancelled operation IDs and optional progress snapshots.
ParquetReaderOptions
Typed options for Parquet reads (propagated into DataFusion).
ParquetWriterOptions
Typed options for Parquet writes (propagated into the ArrowWriter).
SqlDataFrame
Krishiv-owned wrapper around a DataFusion DataFrame.
SqlEngine
SqlExecutionStats
Lightweight execution statistics collected from a DataFusion physical plan.
SqlPlan
SQL planning output.
TaggedQueryResult
A query result annotated with the operation ID that produced it.

Enums§

GroupingMode
Engine-agnostic interface over a prepared query result.
SqlError
SQL-layer errors.

Traits§

KrishivDataFrameOps

Functions§

batch_size_from_env
Resolve the batch size from KRISHIV_BATCH_SIZE env var.
default_parallelism_from_env
Resolve the default parallelism from KRISHIV_TARGET_PARALLELISM env var.
explain_sql
Create bootstrap EXPLAIN text 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_BYTES environment 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. None and 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_LIMIT environment variable.

Type Aliases§

SqlResult
SQL result alias.
SqlStream
Pinned stream of record batches with typed SqlError items.