pub struct MirRelationExprDeserializeContext<'a> {
pub(crate) inner_ctx: MirScalarExprDeserializeContext,
pub(crate) catalog: &'a TestCatalog,
pub(crate) scope: Scope,
}
Expand description
Extends the test case syntax to support MirRelationExprs
A new context should be created for the deserialization of each MirRelationExpr because the context stores state local to each MirRelationExpr.
Includes all the test case syntax extensions to support MirScalarExprs.
The following variants of MirRelationExpr have non-standard syntax:
Let -> the syntax is (let x <value> <body>)
where x is an ident that
should not match any existing ident in any Let statement in
<value>
.
Get -> the syntax is (get x)
, where x is an ident that refers to a
pre-defined source or an ident defined in a let.
Union -> the syntax is (union <input1> .. <inputn>)
.
Constant -> the syntax is
(constant
[[<row1literal1>..<row1literaln>]..[<rowiliteral1>..<rowiliteraln>]]
<RelationType>
)
For convenience, a usize can be alternately specified as #n
.
We recommend specifying a usize as #n
instead of n
when the usize
is a column reference.
Fields§
§inner_ctx: MirScalarExprDeserializeContext
§catalog: &'a TestCatalog
§scope: Scope
Tracks local references when converting spec to JSON. Tracks global references not found in the catalog when converting from JSON to spec.
Implementations§
source§impl<'a> MirRelationExprDeserializeContext<'a>
impl<'a> MirRelationExprDeserializeContext<'a>
pub fn new(catalog: &'a TestCatalog) -> Self
pub fn list_scope_references( &self, ) -> impl Iterator<Item = (&String, &RelationType)>
pub(crate) fn build_constant<I>( &mut self, stream_iter: &mut I, ) -> Result<MirRelationExpr, String>
pub(crate) fn build_constant_err<I>( &mut self, stream_iter: &mut I, ) -> Result<MirRelationExpr, String>
pub(crate) fn build_get( &self, token: Option<TokenTree>, ) -> Result<MirRelationExpr, String>
pub(crate) fn build_let<I>( &mut self, stream_iter: &mut I, ) -> Result<MirRelationExpr, String>
pub(crate) fn build_union<I>( &mut self, stream_iter: &mut I, ) -> Result<MirRelationExpr, String>
pub(crate) fn build_special_mir_if_able<I>( &mut self, first_arg: TokenTree, rest_of_stream: &mut I, ) -> Result<Option<MirRelationExpr>, String>
Trait Implementations§
source§impl<'a> TestDeserializeContext for MirRelationExprDeserializeContext<'a>
impl<'a> TestDeserializeContext for MirRelationExprDeserializeContext<'a>
source§fn override_syntax<I>(
&mut self,
first_arg: TokenTree,
rest_of_stream: &mut I,
type_name: &str,
) -> Result<Option<String>, String>
fn override_syntax<I>( &mut self, first_arg: TokenTree, rest_of_stream: &mut I, type_name: &str, ) -> Result<Option<String>, String>
first_arg
is resolved to JSON. Read moresource§fn reverse_syntax_override(
&mut self,
json: &Value,
type_name: &str,
) -> Option<String>
fn reverse_syntax_override( &mut self, json: &Value, type_name: &str, ) -> Option<String>
json
back to the extended syntax specified by
TestDeserializeContext::override_syntax. Read moreAuto Trait Implementations§
impl<'a> Freeze for MirRelationExprDeserializeContext<'a>
impl<'a> RefUnwindSafe for MirRelationExprDeserializeContext<'a>
impl<'a> Send for MirRelationExprDeserializeContext<'a>
impl<'a> Sync for MirRelationExprDeserializeContext<'a>
impl<'a> Unpin for MirRelationExprDeserializeContext<'a>
impl<'a> UnwindSafe for MirRelationExprDeserializeContext<'a>
Blanket Implementations§
source§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> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.