From ffd4ef54d126212fc8804aa62562d9eec20bec62 Mon Sep 17 00:00:00 2001 From: Tao Yang Date: Wed, 9 Oct 2024 11:56:16 -0700 Subject: [PATCH] Fix the bug that RowIndex column type cannot be serialized (#11208) Summary: I came across a bug when I tried to serialize a TableScanNode with special row index column. ### The isssue `folly::dynamic HiveColumnHandle::serialize()` uses `columnTypeNames` to serialize the TableScanNode. However, RowIndex is missing in `columnTypeNames`. serialize method would raise a std::out_of_range error because of this. ### The fix The fix is simple -- just add row index column to the map. Differential Revision: D64088125 --- velox/connectors/hive/TableHandle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/velox/connectors/hive/TableHandle.cpp b/velox/connectors/hive/TableHandle.cpp index 77088ca754a4..85af047d6e92 100644 --- a/velox/connectors/hive/TableHandle.cpp +++ b/velox/connectors/hive/TableHandle.cpp @@ -25,7 +25,7 @@ columnTypeNames() { {HiveColumnHandle::ColumnType::kPartitionKey, "PartitionKey"}, {HiveColumnHandle::ColumnType::kRegular, "Regular"}, {HiveColumnHandle::ColumnType::kSynthesized, "Synthesized"}, - }; + {HiveColumnHandle::ColumnType::kRowIndex, "RowIndex"}}; } template