13 releases

0.1.4 Jun 11, 2025
0.1.3 Jan 10, 2025
0.1.1 Nov 8, 2024
0.0.11 Nov 29, 2022
0.0.1 Mar 30, 2022

#175 in Encoding

Download history 164063/week @ 2025-03-24 151249/week @ 2025-03-31 162010/week @ 2025-04-07 133485/week @ 2025-04-14 126222/week @ 2025-04-21 100087/week @ 2025-04-28 128148/week @ 2025-05-05 154179/week @ 2025-05-12 156232/week @ 2025-05-19 127579/week @ 2025-05-26 167100/week @ 2025-06-02 153158/week @ 2025-06-09 176104/week @ 2025-06-16 180328/week @ 2025-06-23 205165/week @ 2025-06-30 208427/week @ 2025-07-07

772,205 downloads per month

Apache-2.0

1MB
23K SLoC

Contains (WOFF font, 155KB) src/export/html/fa-solid-900.woff2

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()] or [validate()]. 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.


Substrait query plan validator

This crate implements a validator for Substrait query plans.

[dependencies]
substrait-validator = "0.1.4"

YAML file resolution

One of the complexities of validating Substrait plans is resolving the YAML extension files. By default, the crate only supports file://... URLs, but often, the YAML files will be stored remotely. To make handling this easier, you can enable curl as an optional dependency:

[dependencies]
substrait-validator = { version = "0.1.4", features = ["curl"] }

This adds the substrait_validator::Config::add_curl_yaml_uri_resolver() method, which will use libcurl to resolve the files, thus supporting all the common protocols (http, https, ftp, etc.). The downside is that the curl crate depends on system libraries.

Dependencies

~15–30MB
~437K SLoC