-
Notifications
You must be signed in to change notification settings - Fork 93
Isthmus To/From SQL examples & enhanced APIs #625
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
base: main
Are you sure you want to change the base?
Conversation
d5fc9df to
eb50abf
Compare
I think it's fine having multiple example subprojects that each show how to use each of the 3 modules provided by substrait-java: Core, Isthmus, Spark. It would also show which dependency declarations / Gradle setup one needs to interact with each of the modules. If all of them were in a single examples project then it might be difficult to parse the Gradle setup and understand which dependencies / configuration is needed by which module. |
eb50abf to
c0685ac
Compare
343277e to
c7eb95d
Compare
79933c8 to
7baf2ca
Compare
benbellick
left a comment
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 were some parts I didn't quite get around to reading, but just dumping some comments I have for now. Thank you for doing this! I think it will be a great help :)
Most of my comments are about code comments / the readme. Feel free to ignore whatever if you think my suggestions are less clear. Thanks!
examples/isthmus-api/README.md
Outdated
|
|
||
| ## How does this work in theory? | ||
|
|
||
| In both cases, the Calcite library is used to do parsing and generation of the SQL String. Calcite has it's own relational object model, so there are classes within Isthmus to convert Substrait to and from Calcites object model. |
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.
Edited a bit for clarity
| In both cases, the Calcite library is used to do parsing and generation of the SQL String. Calcite has it's own relational object model, so there are classes within Isthmus to convert Substrait to and from Calcites object model. | |
| The [Calcite](https://calcite.apache.org/) library is used to do parsing and generation of the SQL String. Calcite has it's own relational object model, distinct from substrait's. There are classes within Isthmus to convert Substrait to and from Calcite's object model. |
examples/isthmus-api/src/main/java/io/substrait/examples/ToSql.java
Outdated
Show resolved
Hide resolved
examples/isthmus-api/src/main/java/io/substrait/examples/FromSql.java
Outdated
Show resolved
Hide resolved
examples/isthmus-api/src/main/java/io/substrait/examples/FromSql.java
Outdated
Show resolved
Hide resolved
Starting from two examples of using Isthmus to go from and to SQL a few new methods make the process a lot simpler and symetrical. We found that in use we needed helper wrapper clases, but these could be pushed into the main code. Signed-off-by: MBWhite <[email protected]>
Signed-off-by: MBWhite <[email protected]>
Signed-off-by: MBWhite <[email protected]>
Signed-off-by: MBWhite <[email protected]>
db1e1c9 to
d768adb
Compare
|
Thanks @benbellick - changes made. I've used the batch accepted feature - so hopefully I've not missed any comment - as I agreed with the updates. |
d768adb to
7c1bb7f
Compare
Co-authored-by: Ben Bellick <[email protected]>
Co-authored-by: Ben Bellick <[email protected]>
Co-authored-by: Ben Bellick <[email protected]>
Co-authored-by: Ben Bellick <[email protected]>
Co-authored-by: Ben Bellick <[email protected]>
abadf67 to
c8e010d
Compare
Signed-off-by: MBWhite <[email protected]>
c8e010d to
c9abb2b
Compare
Starting from two examples of using Isthmus to go from and to SQL a few new methods make the process a lot simpler and symetrical.
We found that in use we needed helper wrapper clases, but these could be pushed into the main code.
Note to reviewers
I'll leave as draft until I'm sure the build is good and tests are fully working.
I did create a separate
examplesproject; however it does feel a bit unwieldy to have this and the spark one. Maybe some rework to make a general examples project with sub directories per example 'category'... Happy to make that change if you wish.