Skip to content

Add interface to serialize Substrait plans to Python Bytes.#344

Merged
andygrove merged 1 commit into
apache:mainfrom
kdbrooks:feature/substrait-to-bytes
Apr 25, 2023
Merged

Add interface to serialize Substrait plans to Python Bytes.#344
andygrove merged 1 commit into
apache:mainfrom
kdbrooks:feature/substrait-to-bytes

Conversation

@kdbrooks
Copy link
Copy Markdown
Contributor

Also, Clean up existing Substrait bindings to return bytes instead of List[int].

Which issue does this PR close?

Closes #343

Rationale for this change

What we had before didn't allow for serializing a Substrait plan to ProtoBuf. You had to use a SQL query which was awkward. This also fixes the substrait module return types to be bytes instead of List[int] which is also awkward.

What changes are included in this PR?

Add encode method to datafusion.substrait.plan. Also change datafusion.substrait return types to be bytes instead of List[int].

Are there any user-facing changes?

Yes, but IMO changes for the better.

Clean up existing substrait bindings to return bytes instead of List[int].
@kdbrooks kdbrooks changed the title Add interface to directly serialize Substrait plans to Python Bytes. Add interface to serialize Substrait plans to Python Bytes. Apr 25, 2023
Copy link
Copy Markdown
Contributor

@jdye64 jdye64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylebrooks-8451 thank you for this. Can't believe we missed this the first go around. LGTM. Thanks!

@andygrove andygrove merged commit b6c2115 into apache:main Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Substrait Plan to Protobuf Bytes

3 participants