From 7de9e1bed6094cd5a67aa93d320c85e94b7cc4b2 Mon Sep 17 00:00:00 2001 From: yan ma Date: Wed, 20 Mar 2024 18:57:26 +0800 Subject: [PATCH] Support parquet thrift.convertedType.ENUM with BYTE_ARRAY as schemaElement.type --- velox/dwio/parquet/reader/ParquetReader.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/velox/dwio/parquet/reader/ParquetReader.cpp b/velox/dwio/parquet/reader/ParquetReader.cpp index 83b4f279b18e..dc51c29de20d 100644 --- a/velox/dwio/parquet/reader/ParquetReader.cpp +++ b/velox/dwio/parquet/reader/ParquetReader.cpp @@ -548,10 +548,19 @@ TypePtr ReaderBase::convertType( VELOX_FAIL( "UTF8 converted type can only be set for thrift::Type::(FIXED_LEN_)BYTE_ARRAY"); } + + case thrift::ConvertedType::ENUM: + switch (schemaElement.type) { + case thrift::Type::BYTE_ARRAY: + return VARCHAR(); + default: + VELOX_FAIL( + "ENUM converted type can only be set for thrift::Type::BYTE_ARRAY"); + } + case thrift::ConvertedType::MAP: case thrift::ConvertedType::MAP_KEY_VALUE: case thrift::ConvertedType::LIST: - case thrift::ConvertedType::ENUM: case thrift::ConvertedType::TIME_MILLIS: case thrift::ConvertedType::TIME_MICROS: case thrift::ConvertedType::JSON: