Skip to content

Commit

Permalink
fix: HiveColumnHandle serialization of special columns (#11172)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #11172

Fix missing serialization string name for kRowIndex

Reviewed By: xiaoxmeng, hongtaoy

Differential Revision: D63876868

fbshipit-source-id: 1cc9fb5e8cd2ff69b3c30851960ca16e40807a3e
  • Loading branch information
pedroerp authored and facebook-github-bot committed Oct 23, 2024
1 parent f8397bc commit 687a028
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
3 changes: 2 additions & 1 deletion velox/connectors/hive/TableHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ columnTypeNames() {
{HiveColumnHandle::ColumnType::kPartitionKey, "PartitionKey"},
{HiveColumnHandle::ColumnType::kRegular, "Regular"},
{HiveColumnHandle::ColumnType::kSynthesized, "Synthesized"},
{HiveColumnHandle::ColumnType::kRowIndex, "RowIndex"}};
{HiveColumnHandle::ColumnType::kRowIndex, "RowIndex"},
};
}

template <typename K, typename V>
Expand Down
37 changes: 28 additions & 9 deletions velox/connectors/hive/tests/HiveConnectorSerDeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,34 @@ TEST_F(HiveConnectorSerDeTest, hiveTableHandle) {
}

TEST_F(HiveConnectorSerDeTest, hiveColumnHandle) {
auto columnType = ROW(
{{"c0c0", BIGINT()},
{"c0c1",
ARRAY(MAP(
VARCHAR(), ROW({{"c0c1c0", BIGINT()}, {"c0c1c1", BIGINT()}})))}});
auto columnHandle = exec::test::HiveConnectorTestBase::makeColumnHandle(
"columnHandle", columnType, {"c0.c0c1[3][\"foo\"].c0c1c0"});

testSerde(*columnHandle);
auto columnType = ROW({
{"c0c0", BIGINT()},
{"c0c1",
ARRAY(
MAP(VARCHAR(),
ROW({
{"c0c1c0", BIGINT()},
{"c0c1c1", BIGINT()},
})))},
});

auto columnHandleTypes = {
HiveColumnHandle::ColumnType::kPartitionKey,
HiveColumnHandle::ColumnType::kRegular,
HiveColumnHandle::ColumnType::kSynthesized,
HiveColumnHandle::ColumnType::kRowIndex,
};

for (auto columnHandleType : columnHandleTypes) {
auto columnHandle = exec::test::HiveConnectorTestBase::makeColumnHandle(
"columnHandle",
columnType,
columnType,
{"c0.c0c1[3][\"foo\"].c0c1c0"},
columnHandleType);

testSerde(*columnHandle);
}
}

TEST_F(HiveConnectorSerDeTest, locationHandle) {
Expand Down

0 comments on commit 687a028

Please sign in to comment.