Skip to content

Commit

Permalink
Propagate HiveConfig::kLoadQuantum (#8947)
Browse files Browse the repository at this point in the history
Summary:
The HiveConfig::kLoadQuantum setting should be propagated to readerOptions, enabling DirectBufferedInput to utilize it.

Pull Request resolved: #8947

Reviewed By: xiaoxmeng, pedroerp

Differential Revision: D54500003

Pulled By: mbasmanova

fbshipit-source-id: 73499e1bbbdc808a636d10dd3f2bac2d3787d597
  • Loading branch information
Yohahaha authored and facebook-github-bot committed Mar 5, 2024
1 parent 2e1721f commit 9300329
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions velox/connectors/hive/HiveConnectorUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ void configureReaderOptions(
const RowTypePtr& fileSchema,
const std::shared_ptr<HiveConnectorSplit>& hiveSplit,
const std::unordered_map<std::string, std::string>& tableParameters) {
readerOptions.setLoadQuantum(hiveConfig->loadQuantum());
readerOptions.setMaxCoalesceBytes(hiveConfig->maxCoalescedBytes());
readerOptions.setMaxCoalesceDistance(hiveConfig->maxCoalescedDistanceBytes());
readerOptions.setFileColumnNamesReadAsLowerCase(
Expand Down
3 changes: 3 additions & 0 deletions velox/connectors/hive/tests/HiveConnectorUtilTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ TEST_F(HiveConnectorUtilTest, configureReaderOptions) {
EXPECT_EQ(readerOptions.getFileFormat(), fileFormat);
EXPECT_TRUE(
compareSerDeOptions(readerOptions.getSerDeOptions(), expectedSerDe));
EXPECT_EQ(readerOptions.loadQuantum(), hiveConfig->loadQuantum());
EXPECT_EQ(readerOptions.maxCoalesceBytes(), hiveConfig->maxCoalescedBytes());
EXPECT_EQ(
readerOptions.maxCoalesceDistance(),
Expand Down Expand Up @@ -174,6 +175,7 @@ TEST_F(HiveConnectorUtilTest, configureReaderOptions) {
// Tests other custom reader options.
clearDynamicParameters(FileFormat::TEXT);
std::unordered_map<std::string, std::string> customHiveConfigProps;
customHiveConfigProps[hive::HiveConfig::kLoadQuantum] = "321";
customHiveConfigProps[hive::HiveConfig::kMaxCoalescedBytes] = "129";
customHiveConfigProps[hive::HiveConfig::kMaxCoalescedDistanceBytes] = "513";
customHiveConfigProps[hive::HiveConfig::kFileColumnNamesReadAsLowerCase] =
Expand All @@ -184,6 +186,7 @@ TEST_F(HiveConnectorUtilTest, configureReaderOptions) {
hiveConfig = std::make_shared<hive::HiveConfig>(
std::make_shared<core::MemConfig>(customHiveConfigProps));
performConfigure();
EXPECT_EQ(readerOptions.loadQuantum(), hiveConfig->loadQuantum());
EXPECT_EQ(readerOptions.maxCoalesceBytes(), hiveConfig->maxCoalescedBytes());
EXPECT_EQ(
readerOptions.maxCoalesceDistance(),
Expand Down

0 comments on commit 9300329

Please sign in to comment.