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

Fix write to Nimble table in HiveConnector #10941

Closed
wants to merge 1 commit into from
Closed
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
16 changes: 12 additions & 4 deletions velox/connectors/hive/HiveConnectorUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,12 +993,20 @@ void updateWriterOptionsFromHiveConfig(
const std::shared_ptr<const HiveConfig>& hiveConfig,
const config::ConfigBase* sessionProperties,
std::shared_ptr<dwio::common::WriterOptions>& writerOptions) {
if (fileFormat == dwio::common::FileFormat::PARQUET) {
switch (fileFormat) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@Yuhta should we make this a virtual call to remove the switch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not possible because the virtual call would be in file readers/writers and we need the Hive information here. File formats cannot depend on Hive but the reverse is good.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Yuhta Is there an actual dependency on Hive in these functions? It seems like all they are doing is fetching configs, and the parsing and fetching of these configs probably belongs with the file writer library itself. Similar to what we did for other parquet configs recently.

Copy link
Contributor Author

@Yuhta Yuhta Sep 9, 2024

Choose a reason for hiding this comment

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

It seems our change to WriterOptions is refactored in the mentioned PR. Let's merge this to unblock clients and address the dispatch problem in subsequent diff. One possible solution is to move only the Hive config keys (this should be only one header file and dependency free) into dwio/common, since dw here is almost equivalent to Hive. CC: @xiaoxmeng

case dwio::common::FileFormat::DWRF:
updateDWRFWriterOptions(hiveConfig, sessionProperties, writerOptions);
break;
case dwio::common::FileFormat::PARQUET:
#ifdef VELOX_ENABLE_PARQUET
updateParquetWriterOptions(hiveConfig, sessionProperties, writerOptions);
updateParquetWriterOptions(hiveConfig, sessionProperties, writerOptions);
#endif
} else {
updateDWRFWriterOptions(hiveConfig, sessionProperties, writerOptions);
break;
case dwio::common::FileFormat::NIMBLE:
// No-op for now.
break;
default:
VELOX_UNSUPPORTED("{}", fileFormat);
}
}

Expand Down
Loading