From 5f2b092e055870f5f21c76849556613d87a2b346 Mon Sep 17 00:00:00 2001 From: mayan Date: Sat, 7 Oct 2023 16:20:19 +0000 Subject: [PATCH] support tinyint in SelectiveColumnReader --- velox/dwio/common/SelectiveColumnReader.cpp | 97 ++++++++++++--------- 1 file changed, 54 insertions(+), 43 deletions(-) diff --git a/velox/dwio/common/SelectiveColumnReader.cpp b/velox/dwio/common/SelectiveColumnReader.cpp index 53d40fe628ff9..57be7ce4adf06 100644 --- a/velox/dwio/common/SelectiveColumnReader.cpp +++ b/velox/dwio/common/SelectiveColumnReader.cpp @@ -164,50 +164,61 @@ void SelectiveColumnReader::getIntValues( VELOX_FAIL("Unsupported value size: {}", valueSize_); } break; - case TypeKind::INTEGER: - switch (valueSize_) { - case 8: - getFlatValues(rows, result, requestedType); - break; - case 4: - getFlatValues(rows, result, requestedType); - break; - case 2: - getFlatValues(rows, result, requestedType); - break; - default: - VELOX_FAIL("Unsupported value size: {}", valueSize_); - } - break; - case TypeKind::DATE: - getFlatValues(rows, result, requestedType); - break; - case TypeKind::HUGEINT: - getFlatValues(rows, result, requestedType); - break; - case TypeKind::TIMESTAMP: - getFlatValues(rows, result, requestedType); - break; - case TypeKind::BIGINT: - switch (valueSize_) { - case 8: - getFlatValues(rows, result, requestedType); - break; - case 4: - getFlatValues(rows, result, requestedType); - break; - case 2: - getFlatValues(rows, result, requestedType); - break; - default: - VELOX_FAIL("Unsupported value size: {}", valueSize_); - } - break; - default: - VELOX_FAIL( - "Not a valid type for integer reader: {}", - requestedType->toString()); } + case TypeKind::TINYINT: + switch (valueSize_) { + case 4: + getFlatValues(rows, result, requestedType); + break; + case 2: + getFlatValues(rows, result, requestedType); + break; + default: + VELOX_FAIL("Unsupported value size: {}", valueSize_); + } + break; + case TypeKind::INTEGER: + switch (valueSize_) { + case 8: + getFlatValues(rows, result, requestedType); + break; + case 4: + getFlatValues(rows, result, requestedType); + break; + case 2: + getFlatValues(rows, result, requestedType); + break; + default: + VELOX_FAIL("Unsupported value size: {}", valueSize_); + } + break; + case TypeKind::DATE: + getFlatValues(rows, result, requestedType); + break; + case TypeKind::HUGEINT: + getFlatValues(rows, result, requestedType); + break; + case TypeKind::TIMESTAMP: + getFlatValues(rows, result, requestedType); + break; + case TypeKind::BIGINT: + switch (valueSize_) { + case 8: + getFlatValues(rows, result, requestedType); + break; + case 4: + getFlatValues(rows, result, requestedType); + break; + case 2: + getFlatValues(rows, result, requestedType); + break; + default: + VELOX_FAIL("Unsupported value size: {}", valueSize_); + } + break; + default: + VELOX_FAIL( + "Not a valid type for integer reader: {}", requestedType->toString()); } }