Skip to content
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

feat(planbuilder): Accept schema for tableWriter() #11829

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions velox/exec/tests/utils/PlanBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,10 @@ PlanBuilder& PlanBuilder::tableWrite(
const std::unordered_map<std::string, std::string>& serdeParameters,
const std::shared_ptr<dwio::common::WriterOptions>& options,
const std::string& outputFileName,
const common::CompressionKind compressionKind) {
const common::CompressionKind compressionKind,
const RowTypePtr& schema) {
VELOX_CHECK_NOT_NULL(planNode_, "TableWrite cannot be the source node");
auto rowType = planNode_->outputType();
auto rowType = schema ? schema : planNode_->outputType();

std::vector<std::shared_ptr<const connector::hive::HiveColumnHandle>>
columnHandles;
Expand Down
5 changes: 4 additions & 1 deletion velox/exec/tests/utils/PlanBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ class PlanBuilder {
/// only be specified in non-bucketing write.
/// @param compressionKind Compression scheme to use for writing the
/// output data files.
/// @param schema Output schema to be passed to the writer. By default use the
/// output of the previous operator.
PlanBuilder& tableWrite(
const std::string& outputDirectoryPath,
const std::vector<std::string>& partitionBy,
Expand All @@ -499,7 +501,8 @@ class PlanBuilder {
const std::unordered_map<std::string, std::string>& serdeParameters = {},
const std::shared_ptr<dwio::common::WriterOptions>& options = nullptr,
const std::string& outputFileName = "",
const common::CompressionKind = common::CompressionKind_NONE);
const common::CompressionKind = common::CompressionKind_NONE,
const RowTypePtr& schema = nullptr);

/// Add a TableWriteMergeNode.
PlanBuilder& tableWriteMerge(
Expand Down
Loading