Expand description

Crate for validating Substrait.

Usage

The usage pattern is roughly as follows.

  1. Build a Config structure to configure the validator. You can also just use std::default::Default if you don’t need to configure anything, but you might want to at least call [Config::add_curl_uri_resolver()] (if you’re using the curl feature).
  2. Parse the incoming substrait.Plan message using parse(). This creates a ParseResult, containing a tree structure corresponding to the query plan that also contains diagnostics and other annotations added by the validator.
  3. You can traverse the tree yourself using ParseResult::root, or you can use one of the methods associated with ParseResult to obtain the validation results you need.

Note that only the binary protobuf serialization format is supported at the input; the JSON format is not supported. This is a limitation of prost, the crate that was used for protobuf deserialization. If you’re looking for a library (or CLI) that supports more human-friendly input, check out the Python bindings.

Re-exports

pub use input::config::Config;
pub use output::comment::Comment;
pub use output::diagnostic::Classification;
pub use output::diagnostic::Diagnostic;
pub use output::diagnostic::Level;
pub use output::parse_result::ParseResult;
pub use output::parse_result::Validity;

Modules

Module dealing with serializing a ParseResult to a byte stream in various formats.
Input representation module.
Output representation module.

Structs

A compiled Unix shell style pattern.

Functions

Returns an iterator that yields all known diagnostic classes.
Validates the given substrait.Plan message and returns the parse tree.
Returns the version of Substrait that this version of the validator was built against.
Returns the Substrait version requirement for plans to be known to be supported.
Returns the Substrait version requirement for plans to possibly be supported.
Returns the version of the validator.