Skip to content

Commit

Permalink
fix: HiveColumnHandle serialization of special columns
Browse files Browse the repository at this point in the history
Summary: Fix missing serialization string name for kRowIndex

Reviewed By: xiaoxmeng

Differential Revision: D63876868
  • Loading branch information
pedroerp authored and facebook-github-bot committed Oct 5, 2024
1 parent ddf16c8 commit 63b7761
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
1 change: 1 addition & 0 deletions velox/connectors/hive/TableHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ columnTypeNames() {
{HiveColumnHandle::ColumnType::kPartitionKey, "PartitionKey"},
{HiveColumnHandle::ColumnType::kRegular, "Regular"},
{HiveColumnHandle::ColumnType::kSynthesized, "Synthesized"},
{HiveColumnHandle::ColumnType::kRowIndex, "RowIndex"},
};
}

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 @@ -90,15 +90,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 63b7761

Please sign in to comment.