-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Substrait Installable Extension #3034
Conversation
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.
Thanks for the PR! Looks great. Some comments:
extension/substrait/CMakeLists.txt
Outdated
to_substrait.cpp from_substrait.cpp substrait-extension.cpp | ||
${SUBSTRAIT_SOURCES} ${PROTOBUF_SOURCES}) | ||
|
||
build_loadable_extension(substrait substrait-extension.cpp) |
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 is missing many sources, it will fail when actually used as a loadable extension (although this is not tested right now).
I tried compiling this to check out the created query plans for another project. It seems to work as described, but I'm not sure how to actually get the generated query plan and store it as a protobuf? The duckdb terminal only shows an abbreviated version of the blob:
|
Maybe using it through the shell is not the most practical way, a python script through the python API should be easier. |
@Mytherin I'm only missing the windows-extensions now, but I'm a bit lost on the fixes necessary for it. Any idea what I'm missing or how to gather more debugging info? |
The truncation only happens in the box mode rendering. You can change the rendering using the |
The remaining windows error is related to missing
|
This PR introduces the DuckDB-Substrait Installable Extension.
It also inlines substrait (only the generated CPP code from the proto files) and protobuf.
At this point, this extension is still highly experimental, with all tests being round-trips to and from substrait plans.
To build duckdb with the substrait extension, you need to pass the
BUILD_SUBSTRAIT_EXTENSION
flag on:e.g.,
To use it, two new functions are introduced:
get_substrait()
This function requires a valid SQL query and returns a BLOB column with the serialized query plan.
e.g.,
from_substrait()
This function requires a serialized plan as a BLOB and returns the query result
If the
pragma enable_verification
is executed, we also run an extra query verification step on theget_substrait()
function that roundtrips the query internally and verifies if the results are correct.cc @cpcloud