Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,19 @@ std::shared_ptr<connector::hive::LocationHandle> toLocationHandle(
toTableType(locationHandle.tableType));
}

dwio::common::FileFormat toFileFormat(
const protocol::HiveStorageFormat storageFormat) {
switch (storageFormat) {
case protocol::HiveStorageFormat::DWRF:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we support all these formats now? @majetideepak @Yuhta Thanks!

Copy link
Copy Markdown
Contributor

@Yuhta Yuhta Jun 21, 2023

Choose a reason for hiding this comment

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

No, but we will get an informative reader/writer factory error in velox anyway so it's ok to forward them all here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I removed them to keep it consistent with other similar conversions (eg. TableType TEMPORARY is not forwarded).
The error message is also cleaner in the protocol than a Velox factory error.

return dwio::common::FileFormat::DWRF;
case protocol::HiveStorageFormat::PARQUET:
return dwio::common::FileFormat::PARQUET;
default:
VELOX_UNSUPPORTED(
"Unsupported file format: {}.", toJsonString(storageFormat));
}
}

int64_t toInt64(
const std::shared_ptr<protocol::Block>& block,
const VeloxExprConverter& exprConverter,
Expand Down Expand Up @@ -1766,7 +1779,9 @@ VeloxQueryPlanConverterBase::toVeloxQueryPlan(
}

hiveTableHandle = std::make_shared<connector::hive::HiveInsertTableHandle>(
inputColumns, toLocationHandle(hiveOutputTableHandle->locationHandle));
inputColumns,
toLocationHandle(hiveOutputTableHandle->locationHandle),
toFileFormat(hiveOutputTableHandle->tableStorageFormat));
} else if (
auto insertHandle = std::dynamic_pointer_cast<protocol::InsertHandle>(
tableWriteInfo->writerTarget)) {
Expand All @@ -1788,7 +1803,9 @@ VeloxQueryPlanConverterBase::toVeloxQueryPlan(
}

hiveTableHandle = std::make_shared<connector::hive::HiveInsertTableHandle>(
inputColumns, toLocationHandle(hiveInsertTableHandle->locationHandle));
inputColumns,
toLocationHandle(hiveInsertTableHandle->locationHandle),
toFileFormat(hiveInsertTableHandle->tableStorageFormat));
} else {
VELOX_UNSUPPORTED(
"Unsupported table writer handle: {}",
Expand Down
Loading