JEP-19 Evaluation of Pipe Expressions #5
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Evaluation of Pipe Expressions
Abstract
This JEP introduces changes that outline the exact intended behaviour of evaluating a
pipe-expression
. It also clarifies an ambiguity when evaluating asub-expression
where the left-hand-side evaluates tonull
.Motivation
Sub Expression Evaluation
The specification for
sub-expression
outlines how it should be evaluated using pseudocode:This is slightly ambiguous, as many compliance tests expect the result to be
null
when the left-hand-side evaluates tonull
. So, the real pseudocode shoud in fact be:Pipe Expression Evaluation
In contrast, however, it seems intuitive for
pipe-expression
to evaluate as was originally outlined by the first pseudocode fragment referred to a above.Which means that the evaluation should still happens if the left-hand-side is
null
.Specification
Sub Expressions
The paragraph on sub expressions in the specification will be updated as follows, with changes outlined in bold:
A subexpression is evaluted as follows:
null
, returnnull
.Evaluate the expression on the right with the result of the left expression evaluation.In pseudocode:
Pipe Expressions
Likewise the paragraph on pipe expressions in the specification will be updated as follows:
A pipe expression combines two expressions, separated by the | character. It is similar to a sub-expression with
twothe following important distinctions:sub-expression
restricts the type of expression that can be used on the right hand side.pipe-expression
stops projections on the left hand sideforfrom propagating to the right hand side. If the left expression creates a projection, it does not apply to the right hand side.pipe-expression
evaluates the right expression unconditionally. Asub-expression
shortcuts evaluation if the result of the left expression evaluation isnull
In pseudocode:
Example
`null` . [@]
null
null
`Compliance
The
pipe.json
compliance test file will be updated with the example from this JEP.