Skip to content

Commit

Permalink
Fix compile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Jan 15, 2024
1 parent cddc99b commit be9f06c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
13 changes: 13 additions & 0 deletions velox/exec/tests/utils/QueryAssertions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,14 @@ variant variantAt<TypeKind::TIMESTAMP>(
dataChunk->GetValue(column, row).GetValue<::duckdb::timestamp_t>()));
}

template <>
variant variantAt<TypeKind::UNKNOWN>(
::duckdb::DataChunk* dataChunk,
int32_t row,
int32_t column) {
return variant::null(TypeKind::UNKNOWN);
}

template <TypeKind kind>
variant variantAt(const ::duckdb::Value& value) {
if (value.type() == ::duckdb::LogicalType::INTERVAL) {
Expand All @@ -263,6 +271,11 @@ variant variantAt(const ::duckdb::Value& value) {
}
}

template <>
variant variantAt<TypeKind::UNKNOWN>(const ::duckdb::Value& value) {
return variant::null(TypeKind::UNKNOWN);
}

template <>
velox::variant variantAt<TypeKind::HUGEINT>(const ::duckdb::Value& value) {
auto hugeInt = ::duckdb::HugeIntValue::Get(value);
Expand Down
2 changes: 1 addition & 1 deletion velox/expression/CastExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ VectorPtr CastExpr::applyArray(
return result;
}

// Cast from unkown type to other types.
// Cast from unknown type to other types.
VectorPtr CastExpr::applyUnknown(
const SelectivityVector& rows,
const BaseVector& /*input*/,
Expand Down
7 changes: 7 additions & 0 deletions velox/functions/prestosql/aggregates/PrestoHasher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ FOLLY_ALWAYS_INLINE void PrestoHasher::hash(
hashIntegral<T>(*vector_.get(), rows, hashes);
}

template <>
FOLLY_ALWAYS_INLINE void PrestoHasher::hash<TypeKind::UNKNOWN>(
const SelectivityVector& rows,
BufferPtr& hashes) {
applyHashFunction(rows, *vector_.get(), hashes, [&](auto row) { return 0; });
}

template <>
FOLLY_ALWAYS_INLINE void PrestoHasher::hash<TypeKind::BOOLEAN>(
const SelectivityVector& rows,
Expand Down

0 comments on commit be9f06c

Please sign in to comment.