Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 4.3k
ARROW-16823: [C++] Arrow Substrait enhancements for UDF#13375
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
55751e9
ARROW-16823: [C++] Arrow Substrait enhancements for UDF
rtpsw 2407479
fix parameter doc
rtpsw a9f70b2
fix numeric type
rtpsw dd2aff0
fix unused result
rtpsw 95dcde7
add doc
rtpsw a46ec07
fix numeric type
rtpsw 2941d20
add function registry scoping
rtpsw a91caa2
add substrait tests
rtpsw a9c1870
requested fixes
rtpsw 5c9edba
requested fixes
rtpsw 1d38ae3
requested fixes
rtpsw 38d357b
unexpose NullSinkNodeConsumer
rtpsw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -92,6 +92,9 @@ Status AddExtensionSetToPlan(const ExtensionSet& ext_set, substrait::Plan* plan) | ||
| Result<ExtensionSet> GetExtensionSetFromPlan(const substrait::Plan& plan, | ||
| const ExtensionIdRegistry* registry) { | ||
lidavidm marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| if (registry == NULLPTR) { | ||
| registry = default_extension_id_registry(); | ||
| } | ||
| std::unordered_map<uint32_t, util::string_view> uris; | ||
| uris.reserve(plan.extension_uris_size()); | ||
| for (const auto& uri : plan.extension_uris()) { | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -26,6 +26,7 @@ | ||
| #include "arrow/buffer.h" | ||
| #include "arrow/compute/exec/exec_plan.h" | ||
| #include "arrow/compute/exec/options.h" | ||
| #include "arrow/dataset/file_base.h" | ||
| #include "arrow/engine/substrait/extension_set.h" | ||
| #include "arrow/engine/substrait/visibility.h" | ||
| #include "arrow/result.h" | ||
| @@ -40,21 +41,79 @@ using ConsumerFactory = std::function<std::shared_ptr<compute::SinkNodeConsumer> | ||
| /// \brief Deserializes a Substrait Plan message to a list of ExecNode declarations | ||
| /// | ||
| /// The output of each top-level Substrait relation will be sent to a caller supplied | ||
| /// consumer function provided by consumer_factory | ||
| /// | ||
| /// \param[in] buf a buffer containing the protobuf serialization of a Substrait Plan | ||
| /// message | ||
| /// \param[in] consumer_factory factory function for generating the node that consumes | ||
| /// the batches produced by each toplevel Substrait relation | ||
| /// \param[in] registry an extension-id-registry to use, or null for the default one. | ||
| /// \param[out] ext_set_out if non-null, the extension mapping used by the Substrait | ||
| /// Plan is returned here. | ||
| /// \return a vector of ExecNode declarations, one for each toplevel relation in the | ||
| /// Substrait Plan | ||
| ARROW_ENGINE_EXPORT Result<std::vector<compute::Declaration>> DeserializePlans( | ||
| const Buffer& buf, const ConsumerFactory& consumer_factory, | ||
| ExtensionSet* ext_set_out = NULLPTR); | ||
| const ExtensionIdRegistry* registry = NULLPTR, ExtensionSet* ext_set_out = NULLPTR); | ||
| /// \brief Deserializes a single-relation Substrait Plan message to an execution plan | ||
| /// | ||
| /// The output of each top-level Substrait relation will be sent to a caller supplied | ||
| /// consumer function provided by consumer_factory | ||
| /// | ||
| /// \param[in] buf a buffer containing the protobuf serialization of a Substrait Plan | ||
| /// message | ||
| /// \param[in] consumer node that consumes the batches produced by each toplevel Substrait | ||
| /// relation | ||
| /// \param[in] registry an extension-id-registry to use, or null for the default one. | ||
| /// \param[out] ext_set_out if non-null, the extension mapping used by the Substrait | ||
| /// Plan is returned here. | ||
| /// \return an ExecNode corresponding to the single toplevel relation in the Substrait | ||
| /// Plan | ||
| Result<compute::ExecPlan> DeserializePlan( | ||
| const Buffer& buf, const std::shared_ptr<compute::SinkNodeConsumer>& consumer, | ||
| const ExtensionIdRegistry* registry = NULLPTR, ExtensionSet* ext_set_out = NULLPTR); | ||
| /// Factory function type for generating the write options of a node consuming the batches | ||
| /// produced by each toplevel Substrait relation when deserializing a Substrait Plan. | ||
| using WriteOptionsFactory = std::function<std::shared_ptr<dataset::WriteNodeOptions>()>; | ||
| /// \brief Deserializes a Substrait Plan message to a list of ExecNode declarations | ||
| /// | ||
| /// The output of each top-level Substrait relation will be written to a filesystem. | ||
| /// `write_options_factory` can be used to control write behavior. | ||
| /// | ||
| /// \param[in] buf a buffer containing the protobuf serialization of a Substrait Plan | ||
| /// message | ||
| /// \param[in] write_options_factory factory function for generating the write options of | ||
| /// a node consuming the batches produced by each toplevel Substrait relation | ||
| /// \param[in] registry an extension-id-registry to use, or null for the default one. | ||
| /// \param[out] ext_set_out if non-null, the extension mapping used by the Substrait | ||
| /// Plan is returned here. | ||
| /// \return a vector of ExecNode declarations, one for each toplevel relation in the | ||
| /// Substrait Plan | ||
| ARROW_ENGINE_EXPORT Result<std::vector<compute::Declaration>> DeserializePlans( | ||
rtpsw marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| const Buffer& buf, const WriteOptionsFactory& write_options_factory, | ||
| const ExtensionIdRegistry* registry = NULLPTR, ExtensionSet* ext_set_out = NULLPTR); | ||
| Result<compute::ExecPlan> DeserializePlan(const Buffer& buf, | ||
| const ConsumerFactory& consumer_factory, | ||
| ExtensionSet* ext_set_out = NULLPTR); | ||
| /// \brief Deserializes a single-relation Substrait Plan message to an execution plan | ||
| /// | ||
| /// The output of the single Substrait relation will be written to a filesystem. | ||
| /// `write_options_factory` can be used to control write behavior. | ||
| /// | ||
| /// \param[in] buf a buffer containing the protobuf serialization of a Substrait Plan | ||
| /// message | ||
| /// \param[in] write_options write options of a node consuming the batches produced by | ||
| /// each toplevel Substrait relation | ||
| /// \param[in] registry an extension-id-registry to use, or null for the default one. | ||
| /// \param[out] ext_set_out if non-null, the extension mapping used by the Substrait | ||
| /// Plan is returned here. | ||
| /// \return a vector of ExecNode declarations, one for each toplevel relation in the | ||
| /// Substrait Plan | ||
| ARROW_ENGINE_EXPORT Result<compute::ExecPlan> DeserializePlan( | ||
| const Buffer& buf, const std::shared_ptr<dataset::WriteNodeOptions>& write_options, | ||
| const ExtensionIdRegistry* registry = NULLPTR, ExtensionSet* ext_set_out = NULLPTR); | ||
| /// \brief Deserializes a Substrait Type message to the corresponding Arrow type | ||
| /// | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.