-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A "let" expression #415
Comments
Calcite's |
@julianhyde is |
Not exactly. It is a collection of expressions and a filter. If you squint you could regard it as an expression that returns an optional tuple. But I do think it solves the requirement for common subexpressions admirably. An ordinary "let" expression, without the ability to return tuples, is going to struggle with cases like this (in Standard ML-like pseudocode), with multiple outputs based on the same common subexpressions:
and this one, where output is conditional on an intermediate expression:
|
@julianhyde If it isn't an expression then how do we use it? For example, a project is currently defined as:
Should we change field 3 to a repeated |
I believe this has been brought up a couple of times before as part of #287 and somewhat in #320, but I thought it would be worth discussing explicitly.
The idea is whether it should be possible to reference common subexpressions. Either using an explicit "let" expression operator, e.g.
let x = y + z; and(gt(a, x), lte(b, x))
or by pulling them to the plan-level as is done with the relation reference operator.The text was updated successfully, but these errors were encountered: