Expand description
Hamelin core library — parser, AST, type-checker, and translation logic.
Start with parse to get an AST, then type_check to type-check it.
Each function has a _with_options variant that takes an options struct
built via bon::Builder for customising behaviour (interner, provider,
time range, etc.).
All functions return WithTranslationErrors<T> which can be converted to
Result via .result(), or destructured to access .output and .errors.
Re-exports§
pub use crate::err::TemplateSubstitutionError;pub use crate::time_range::TimeRange;pub use crate::tree::options::parse_default_space;pub use crate::tree::options::ExpressionTypeCheckOptions;pub use crate::tree::options::QueryValidationMode;pub use crate::tree::options::TemplateParameterKind;pub use crate::tree::options::TemplateParameterValue;pub use crate::tree::options::TranslateOptions;pub use crate::tree::substitute_query;pub use crate::tree::combine_parsed_queries_for_inlining;pub use crate::tree::combine_queries_for_inlining;pub use crate::tree::rewrite_table_references;pub use crate::tree::CombineQueriesError;pub use crate::tree::CombineQueriesOk;pub use crate::tree::CteInline;pub use crate::tree::ParsedCteInline;
Modules§
- antlr
- catalog
- completion
- err
- func
- interner
- String and type interner for memory-efficient storage.
- operator
- parser
- provider
- sql
- time_
range - translation
- tree
- types
Enums§
Constants§
- BARE_
DATASET_ BOOST - Datasets with no namespace: the plainest names in the current space.
- CONNECTOR_
DATASET_ BOOST - Datasets under
connectors, demoted below everything else (SIM-5588). - CURRENT_
SPACE_ BOOST - Extra credit for a dataset in the query’s default space.
- EVENTS_
DATASET_ BOOST - Datasets under
eventsorevents_ecs. - FIELD_
BOOST - Fields of the row being queried, which outrank functions when nothing else separates them.
- PIPELINE_
DEF_ BOOST - Pipeline definitions are declared in the query being written, so they outrank anything that came from the catalog.
- SIGNALS_
DATASET_ BOOST - Datasets under
signals. - UNRECOGNIZED_
DATASET_ BOOST - Datasets under a namespace this ladder does not recognize.
- VERSION
Functions§
- f64_
to_ i64 - Truncate an f64 to i64 matching native
CastKind::DoubleToInt: NaN / ±Inf / out-of-range values produceNone; finite values truncate toward zero. - parse
- Parse a Hamelin query string into an AST.
- parse_
and_ typecheck - Parse and type-check a Hamelin query string in one step.
- parse_
and_ typecheck_ with_ options - Parse and type-check a Hamelin query string with configurable options.
- parse_
string_ as_ bool - Parse a string as a boolean using the same acceptance set as Arrow’s
cast_string_to_booleankernel (arrow-cast/src/cast/string.rs). Case insensitive with leading/trailing whitespace trimmed; acceptstrue/false/yes/no/on/off/1/0and their prefixes. - parse_
timestamp_ to_ utc - Parse a timestamp string into a UTC
DateTime, accepting the format set shared between eval (cast_string_to_timestamp) and the DataFusionparse_timestamp_microsUDF: RFC3339 first, then several timezone-aware and naive formats, then date-only fallbacks. - parse_
with_ options - Parse a Hamelin query string with configurable options.
- type_
check - Type-check a parsed AST with default options.
- type_
check_ expression - Type-check an expression AST node with configurable options.
- type_
check_ with_ options - Type-check a parsed AST with configurable options.
- type_
check_ with_ provider