From 838ee2026f4f2216291528448787dd0e08809031 Mon Sep 17 00:00:00 2001 From: Jeroen van Straten Date: Mon, 26 Sep 2022 14:27:43 +0200 Subject: [PATCH 1/3] feat: attach Substrait version number to plans --- proto/substrait/plan.proto | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/proto/substrait/plan.proto b/proto/substrait/plan.proto index 8614e08ef..6489e68c1 100644 --- a/proto/substrait/plan.proto +++ b/proto/substrait/plan.proto @@ -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; @@ -43,3 +47,20 @@ message Plan { // one or more message types defined here are unknown. repeated string expected_type_urls = 5; } + +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; +} From 9b1dfbadaa2369e36322b5cf725ca72eb4f74e8b Mon Sep 17 00:00:00 2001 From: Jeroen van Straten Date: Mon, 3 Oct 2022 13:24:25 +0200 Subject: [PATCH 2/3] feat: add PlanVersion message --- proto/substrait/plan.proto | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/proto/substrait/plan.proto b/proto/substrait/plan.proto index 6489e68c1..145e4b291 100644 --- a/proto/substrait/plan.proto +++ b/proto/substrait/plan.proto @@ -48,6 +48,15 @@ message Plan { 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; From 1d6fa7c23e227e4e4bcf5dce7c5f68b7fe4c779b Mon Sep 17 00:00:00 2001 From: Jeroen van Straten Date: Tue, 4 Oct 2022 16:12:55 +0200 Subject: [PATCH 3/3] feat: add producer identification string --- proto/substrait/plan.proto | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/proto/substrait/plan.proto b/proto/substrait/plan.proto index 145e4b291..0371574e3 100644 --- a/proto/substrait/plan.proto +++ b/proto/substrait/plan.proto @@ -72,4 +72,11 @@ message 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; }