-
Notifications
You must be signed in to change notification settings - Fork 165
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
feat: add APPLY operator representation #363
Conversation
This PR adds a new relation type for APPLY operation. Apply is similar to JOIN operator since it joins two table sources. However the table source on the right depends on computation of the table source on right. Since the right source cannot be computed without right, it is represented by an Expression and not a relation. In Substrait the right source will most likely be a SubQuery.
Following up here @ashvina , did you see my question about the need for an additional subquery type? |
Hi @jacques-n. Sorry, I missed your question earlier. I agree, to properly support Although, I think extension of Assuming a new Note, the APPLY is generally used with |
ApplyType type = 4; | ||
|
||
enum ApplyType { | ||
Apply_TYPE_UNSPECIFIED = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why lower case Apply here and APPLY for the next two?
This has been on my "to do" list for a while but I finally got around to looking at it because some behavior like cross apply is being discussed in Arrow (apache/arrow#14682). @jacques-n I am curious if this really is a subquery. @ashvina I am also uncertain about expressing the Correlated subqueries traditionally return a single value (maybe a single row if multiple aggregates) for each input row:
However, the right side in a cross apply could return a complete table for each input row. Or it could (I think) return nothing at all. That being said, I may be significantly misunderstanding any of these points and would appreciate any clarification. |
@ashvina is this still in progress? |
No progress has been made in more than six months. Closing without prejudice. |
This PR adds a new relation type for APPLY operation. APPLY is similar to JOIN
operator since it joins two table sources. However, in APPLY, the table source
on the right depends on the result of computation of the table source on left.
Since the right source cannot be computed without left, the right source is
represented by an Expression in Substrait and not a relation. The right source
will most frequently be a SubQuery.
Closes #357