pub struct Node {
pub class: i32,
pub brief: Option<Comment>,
pub summary: Option<Comment>,
pub data_type: Option<DataType>,
pub data: Vec<Data>,
pub node_type: Option<NodeType>,
}Expand description
Nodes of the validator parse result tree.
Note that, unlike substrait.Plan and its children, the nodes in this tree are intentionally devoid of typing information: all nodes are of type Node. The purpose of this is to allow a consumer of these trees to walk over the entire tree without needing in-depth knowledge of how Substrait works (and, with that, to decouple them from changes to the Substrait specification): they are intended as an intermediate format for converting Substrait plans into more human-friendly representations after all, not for programmatically dealing with the semantics of Substrait itself. That’s what the validator is for, in this case.
In particular, gathering all diagnostics emitted by the validator only requires the consumer to use the Node, Node.Data, Node.Child, and of course the Diagnostic message types.
In case the consumer does need additional information from the original substrait.Plan, every node can be related back to its corresponding message via the path information associated with the nodes.
Fields§
§class: i32Semantic classification of this node.
brief: Option<Comment>Optional brief description of the node. Should not contain newlines or other non-span formatting information.
summary: Option<Comment>Optional summary of the node. Unlike brief, this may contain paragraph-level formatting information.
data_type: Option<DataType>For the following types of nodes, the validator will try to do type resolution:
- type-like nodes resolve to said type;
- expression-like nodes resolve to the type returned by the expression;
- relation-like nodes resolve to the schema (as a named struct) returned by the relation. This field will be populated for such nodes even if resolution fails, to indicate that there is supposed to be a type. In that case, the type kind will be set to “unresolved.” The field will not be populated for nodes that don’t have a logical Substrait type.
data: Vec<Data>Data associated with the node. Note that some variants are illegal based on the node type (for example, a primitive does not have fields, so it makes no sense for Field data to appear).
node_type: Option<NodeType>The type of node.
Implementations§
Trait Implementations§
Source§impl InputNode for Node
impl InputNode for Node
Source§fn type_to_node() -> Node
fn type_to_node() -> Node
Source§fn data_to_node(&self) -> Node
fn data_to_node(&self) -> Node
Source§fn oneof_variant(&self) -> Option<&'static str>
fn oneof_variant(&self) -> Option<&'static str>
Source§fn parse_unknown(&self, y: &mut Context<'_>) -> bool
fn parse_unknown(&self, y: &mut Context<'_>) -> bool
Source§impl Message for Node
impl Message for Node
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl ProtoMessage for Node
impl ProtoMessage for Node
Source§fn proto_message_type() -> &'static str
fn proto_message_type() -> &'static str
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more