-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
New IR -- WIP #24466
base: master
Are you sure you want to change the base?
New IR -- WIP #24466
Conversation
ed4c70f
to
6ea030e
Compare
example assembly printout
|
30ed4b3
to
852f33b
Compare
d71a5b9
to
8f19d4a
Compare
687d453
to
fdaffa9
Compare
fdaffa9
to
9050e1c
Compare
5383dcf
to
0a5463b
Compare
bf82af6
to
1b12725
Compare
1b12725
to
61a2bee
Compare
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.
I believe that the attributes should be on the top level of the dialect, as opposed to being part of an operation.
IR allows mixing dialects. In particular, an operation can have attributes from another dialect. For example, the trino.query
operation has the attribute ir.terminal
. The dialect is supposed to understand an attribute outside the context of an operation.
{ | ||
// Intermediate result row type. | ||
// Row without fields is supported and represented as EmptyRowType. | ||
// If row fields are present, they must have valid unique names. |
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.
Currently, the intermediate relation row type has field names, and the fields are referenced by name with the FieldSelection operation. It will be refactored so that the row type is anonymous, and the fields will be referenced by index with the FieldReference operation.
Explanation:
The query program must work correctly with the Memo and Equivalence Classes. For that purpose, the intermediate relation type must be generic. Each operation in an Equivalence Class must derive exactly the same output type, because they all must be compatible with the downstream program.
Due to this limitation, field names in the intermediate row type aren't very useful. We must use generic sequential names, for example f_1
, f_2
, f_3
... Using indexes would be more concise.
if (leftCriteriaSelector.parameters().size() != 1 || | ||
!trinoType(leftCriteriaSelector.parameters().getFirst().type()).equals(relationRowType(trinoType(left.type()))) || | ||
!(trinoType(leftCriteriaSelector.getReturnedType()) instanceof RowType || trinoType(leftCriteriaSelector.getReturnedType()).equals(EMPTY_ROW))) { | ||
throw new TrinoException(IR_ERROR, "invalid left criteria selector for Join operation"); | ||
} |
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.
There is a lot of repetition of this code across different operation classes. It will be extracted and reused.
efa6f93
to
27649af
Compare
27649af
to
40aeed5
Compare
See core/trino-main/src/main/java/io/trino/sql/newir/README.md for details.