-
Notifications
You must be signed in to change notification settings - Fork 87
feat(isthmus): introduce SubstraitSqlToCalcite and SubstraitStatementParser #474
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
Conversation
e887474
to
cc5da77
Compare
This PR continues the work of #362 in splitting the SQL -> Calcite and Calcite -> Substrait API into modulate components. |
isthmus/src/test/java/io/substrait/isthmus/ApplyJoinPlanTest.java
Outdated
Show resolved
Hide resolved
isthmus/src/main/java/io/substrait/isthmus/sql/SubstraitSqlToCalcite.java
Outdated
Show resolved
Hide resolved
d0e0aa4
to
41670c2
Compare
isthmus/src/main/java/io/substrait/isthmus/sql/SubstraitSqlToCalcite.java
Outdated
Show resolved
Hide resolved
isthmus/src/main/java/io/substrait/isthmus/sql/SubstraitSqlToCalcite.java
Outdated
Show resolved
Hide resolved
isthmus/src/main/java/io/substrait/isthmus/sql/SubstraitSqlStatementParser.java
Outdated
Show resolved
Hide resolved
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.
LGTM with the few minor documentation fixes please see comment below
org.apache.calcite.rel.RelRoot calciteRelRoot1 = | ||
SubstraitSqlToCalcite.convertQuery(query, catalogReader); | ||
assertEquals(expectedNames, calciteRelRoot1.validatedRowType.getFieldNames()); |
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.
This change I don't fully follow. How is it an improvement that we are testing SQL to Calcite before we test SQL to Substrait? Shouldn't it be sufficient if we test SQL to Substrait since that is our non-experimentation public API? Shouldn't it be obvious that Calcite's SQL To RelNode conversion preserves the 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.
Shouldn't it be obvious that Calcite's SQL To RelNode conversion preserves the names?
You would think so, but if you get rid of the quoting the (current) parser settings will uppercase all the identifiers. This was checked indirectly, but because I had access to a convenient converter from Sql to Calcite now I felt that adding a direct check for this would be helpful.
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.
sorry, approved maybe a little to soon. can you enlighten me on the reasoning behind the changes to NameRoundtripTest
and PlanTestBase
. What are we gaining by breaking these into multiple steps instead of using the SqlToSubstrait
wrapper?
2797435
to
c48bcce
Compare
No description provided.