substrait-extensions
Packaged Substrait extension files for Rust.
This crate bundles the Substrait specification's
extension YAML files,
the text-based JSON schemas,
and the function test cases, alongside Rust types generated from the schemas
with typify.
Versions of this crate correspond to Substrait
releases. vx.y.z of
substrait-extensions contains the files from vx.y.z of the
substrait repository.
Usage
use ;
use SimpleExtensions;
use TESTCASES;
// Parse a bundled extension file into the generated type.
let arithmetic: SimpleExtensions = from_str.unwrap;
// Or look it up by file stem in the prebuilt map.
let arithmetic = &EXTENSIONS;
text— types generated from the text schemas (e.g.text::simple_extensions::SimpleExtensions,text::dialect::Dialect).extensions— the embedded extension YAML files (as&strconstants) and theEXTENSIONSlookup map.testcases— the embedded function test case files (aninclude_dir::Dir).
Generation and Publishing
Code generation and publishing is handled in the substrait-packaging repository.
When a new version of the Substrait specification is released, automation vendors
the extension files for that version and pushes them to GitHub with a tag
formatted like rust/substrait-extensions/vx.y.z. The automation then publishes
that crate to crates.io.
Local Generation
The generate_extensions.sh script can be executed locally to vendor the
extension files. Set SUBSTRAIT_HOME to a directory containing the Substrait
specification (defaults to ../../substrait).