Skip to content

Commit

Permalink
support tinyint in SelectiveColumnReader
Browse files Browse the repository at this point in the history
  • Loading branch information
yma11 committed Oct 7, 2023
1 parent 1910a17 commit 5f2b092
Showing 1 changed file with 54 additions and 43 deletions.
97 changes: 54 additions & 43 deletions velox/dwio/common/SelectiveColumnReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,50 +164,61 @@ void SelectiveColumnReader::getIntValues(
VELOX_FAIL("Unsupported value size: {}", valueSize_);
}
break;
case TypeKind::INTEGER:
switch (valueSize_) {
case 8:
getFlatValues<int64_t, int32_t>(rows, result, requestedType);
break;
case 4:
getFlatValues<int32_t, int32_t>(rows, result, requestedType);
break;
case 2:
getFlatValues<int16_t, int32_t>(rows, result, requestedType);
break;
default:
VELOX_FAIL("Unsupported value size: {}", valueSize_);
}
break;
case TypeKind::DATE:
getFlatValues<Date, Date>(rows, result, requestedType);
break;
case TypeKind::HUGEINT:
getFlatValues<int128_t, int128_t>(rows, result, requestedType);
break;
case TypeKind::TIMESTAMP:
getFlatValues<Timestamp, Timestamp>(rows, result, requestedType);
break;
case TypeKind::BIGINT:
switch (valueSize_) {
case 8:
getFlatValues<int64_t, int64_t>(rows, result, requestedType);
break;
case 4:
getFlatValues<int32_t, int64_t>(rows, result, requestedType);
break;
case 2:
getFlatValues<int16_t, int64_t>(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<int32_t, int8_t>(rows, result, requestedType);
break;
case 2:
getFlatValues<int16_t, int8_t>(rows, result, requestedType);
break;
default:
VELOX_FAIL("Unsupported value size: {}", valueSize_);
}
break;
case TypeKind::INTEGER:
switch (valueSize_) {
case 8:
getFlatValues<int64_t, int32_t>(rows, result, requestedType);
break;
case 4:
getFlatValues<int32_t, int32_t>(rows, result, requestedType);
break;
case 2:
getFlatValues<int16_t, int32_t>(rows, result, requestedType);
break;
default:
VELOX_FAIL("Unsupported value size: {}", valueSize_);
}
break;
case TypeKind::DATE:
getFlatValues<Date, Date>(rows, result, requestedType);
break;
case TypeKind::HUGEINT:
getFlatValues<int128_t, int128_t>(rows, result, requestedType);
break;
case TypeKind::TIMESTAMP:
getFlatValues<Timestamp, Timestamp>(rows, result, requestedType);
break;
case TypeKind::BIGINT:
switch (valueSize_) {
case 8:
getFlatValues<int64_t, int64_t>(rows, result, requestedType);
break;
case 4:
getFlatValues<int32_t, int64_t>(rows, result, requestedType);
break;
case 2:
getFlatValues<int16_t, int64_t>(rows, result, requestedType);
break;
default:
VELOX_FAIL("Unsupported value size: {}", valueSize_);
}
break;
default:
VELOX_FAIL(
"Not a valid type for integer reader: {}", requestedType->toString());
}
}

Expand Down

0 comments on commit 5f2b092

Please sign in to comment.