Skip to content

Commit

Permalink
feat: attach Substrait version number to plans (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanstraten authored Oct 5, 2022
1 parent 7e6faac commit 2d1bb9d
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions proto/substrait/plan.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ message PlanRel {
// Describe a set of operations to complete.
// For compactness sake, identifiers are normalized at the plan level.
message Plan {
// Substrait version of the plan. Optional up to 0.17.0, required for later
// versions.
Version version = 6;

// a list of yaml specifications this plan may depend on
repeated substrait.extensions.SimpleExtensionURI extension_uris = 1;

Expand All @@ -43,3 +47,36 @@ message Plan {
// one or more message types defined here are unknown.
repeated string expected_type_urls = 5;
}

// This message type can be used to deserialize only the version of a Substrait
// Plan message. This prevents deserialization errors when there were breaking
// changes between the Substrait version of the tool that produced the plan and
// the Substrait version used to deserialize it, such that a consumer can emit
// a more helpful error message in this case.
message PlanVersion {
Version version = 6;
}

message Version {
// Substrait version number.
uint32 major = 1;
uint32 minor = 2;
uint32 patch = 3;

// If a particular version of Substrait is used that does not correspond to
// a version number exactly (for example when using an unofficial fork or
// using a version that is not yet released or is between versions), set this
// to the full git hash of the utilized commit of
// https://github.com/substrait-io/substrait (or fork thereof), represented
// using a lowercase hex ASCII string 40 characters in length. The version
// number above should be set to the most recent version tag in the history
// of that commit.
string git_hash = 4;

// Identifying information for the producer that created this plan. Under
// ideal circumstances, consumers should not need this information. However,
// it is foreseen that consumers may need to work around bugs in particular
// producers in practice, and therefore may need to know which producer
// created the plan.
string producer = 5;
}

0 comments on commit 2d1bb9d

Please sign in to comment.