Skip to content

Commit

Permalink
Fix creation of DuckDB tables with arrays of boolean, tinyint and sma…
Browse files Browse the repository at this point in the history
…llint
  • Loading branch information
mbasmanova committed Jan 17, 2024
1 parent 31caefc commit 72f9bf2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions velox/exec/tests/utils/QueryAssertions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,30 @@ ::duckdb::Value duckValueAt(const VectorPtr& vector, vector_size_t index) {
return ::duckdb::Value(vector->as<SimpleVector<T>>()->valueAt(index));
}

template <>
::duckdb::Value duckValueAt<TypeKind::TINYINT>(
const VectorPtr& vector,
vector_size_t index) {
return ::duckdb::Value::TINYINT(
vector->as<SimpleVector<int8_t>>()->valueAt(index));
}

template <>
::duckdb::Value duckValueAt<TypeKind::SMALLINT>(
const VectorPtr& vector,
vector_size_t index) {
return ::duckdb::Value::TINYINT(
vector->as<SimpleVector<int16_t>>()->valueAt(index));
}

template <>
::duckdb::Value duckValueAt<TypeKind::BOOLEAN>(
const VectorPtr& vector,
vector_size_t index) {
return ::duckdb::Value::BOOLEAN(
vector->as<SimpleVector<bool>>()->valueAt(index));
}

template <>
::duckdb::Value duckValueAt<TypeKind::VARCHAR>(
const VectorPtr& vector,
Expand Down

0 comments on commit 72f9bf2

Please sign in to comment.