From 2e84c5a29784cbdf0f1e6d149d44fbba0b62117c Mon Sep 17 00:00:00 2001 From: Jimmy Lu Date: Mon, 9 Sep 2024 09:42:50 -0700 Subject: [PATCH] Fix write to Nimble table in HiveConnector (#10941) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/10941 Recent refactor https://github.com/facebookincubator/velox/pull/10915 breaks the capability to write to Nimble table in Hive connector, fix it. Reviewed By: xiaoxmeng Differential Revision: D62302602 --- velox/connectors/hive/HiveConnectorUtil.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/velox/connectors/hive/HiveConnectorUtil.cpp b/velox/connectors/hive/HiveConnectorUtil.cpp index 236120e1763f..ac7289c5b261 100644 --- a/velox/connectors/hive/HiveConnectorUtil.cpp +++ b/velox/connectors/hive/HiveConnectorUtil.cpp @@ -993,12 +993,20 @@ void updateWriterOptionsFromHiveConfig( const std::shared_ptr& hiveConfig, const config::ConfigBase* sessionProperties, std::shared_ptr& writerOptions) { - if (fileFormat == dwio::common::FileFormat::PARQUET) { + switch (fileFormat) { + 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); } }