Skip to main content

Module create_function_ddl

Module create_function_ddl 

Source
Expand description

Pre-processor for CREATE FUNCTION … RETURNS TABLE DDL.

DataFusion does not natively understand the Krishiv-extended CREATE FUNCTION … RETURNS TABLE (col TYPE, …) LANGUAGE … AS '…' syntax. This module intercepts such statements before they reach DataFusion and registers a TableUdf backed by either:

  • A SQL body (LANGUAGE sql AS '…') — executed via the session context.
  • A runtime-provided Rust closure — registered via SqlEngine::register_table_udf_fn.

Unsupported DDL languages are rejected before any registry mutation.

Structs§

ClosureTableUdf
A TableUdf backed by a runtime-provided Rust closure.
ColumnDef
A column definition extracted from the RETURNS TABLE (…) clause.
CreateFunctionDdl
Parsed descriptor produced by parse_create_function.
FunctionArgDef
A typed function argument extracted from the function signature.
SqlBodyTableUdf
A TableUdf whose body is a SQL query executed via a DataFusion session.

Functions§

is_create_function_returns_table
Return true if sql looks like a CREATE FUNCTION … RETURNS TABLE … statement (case-insensitive, leading/trailing whitespace allowed).
parse_create_function
Parse a CREATE FUNCTION … RETURNS TABLE (…) statement and return a CreateFunctionDdl descriptor.

Type Aliases§

UdtfBodyFn
Body-function type alias for runtime-registered UDTFs.