Commit e461e868 authored by Jeff Daily's avatar Jeff Daily
Browse files

Fix error in cpp_tests/test_arrow.cpp.

error: explicit specialization in non-namespace scope ‘class ArrowChunkedArrayTest’
parent 61ec4f1a
...@@ -148,65 +148,66 @@ class ArrowChunkedArrayTest : public testing::Test { ...@@ -148,65 +148,66 @@ class ArrowChunkedArrayTest : public testing::Test {
arr.private_data = nullptr; arr.private_data = nullptr;
return arr; return arr;
} }
};
/* ------------------------------------- SCHEMA CREATION ------------------------------------- */
template <typename T> /* ------------------------------------- SCHEMA CREATION ------------------------------------- */
ArrowSchema create_primitive_schema() {
std::logic_error("not implemented");
}
template <> template <typename T>
ArrowSchema create_primitive_schema<float>() { ArrowSchema create_primitive_schema() {
ArrowSchema schema; std::logic_error("not implemented");
schema.format = "f"; }
schema.name = nullptr;
schema.metadata = nullptr;
schema.flags = 0;
schema.n_children = 0;
schema.children = nullptr;
schema.dictionary = nullptr;
schema.release = nullptr;
schema.private_data = nullptr;
return schema;
}
template <> template <>
ArrowSchema create_primitive_schema<bool>() { ArrowSchema create_primitive_schema<float>() {
ArrowSchema schema; ArrowSchema schema;
schema.format = "b"; schema.format = "f";
schema.name = nullptr; schema.name = nullptr;
schema.metadata = nullptr; schema.metadata = nullptr;
schema.flags = 0; schema.flags = 0;
schema.n_children = 0; schema.n_children = 0;
schema.children = nullptr; schema.children = nullptr;
schema.dictionary = nullptr; schema.dictionary = nullptr;
schema.release = nullptr; schema.release = nullptr;
schema.private_data = nullptr; schema.private_data = nullptr;
return schema; return schema;
} }
ArrowSchema create_nested_schema(const std::vector<ArrowSchema*>& arrays) { template <>
auto children = static_cast<ArrowSchema**>(malloc(sizeof(ArrowSchema*) * arrays.size())); ArrowSchema create_primitive_schema<bool>() {
for (size_t i = 0; i < arrays.size(); ++i) { ArrowSchema schema;
auto child = static_cast<ArrowSchema*>(malloc(sizeof(ArrowSchema))); schema.format = "b";
*child = *arrays[i]; schema.name = nullptr;
children[i] = child; schema.metadata = nullptr;
} schema.flags = 0;
schema.n_children = 0;
schema.children = nullptr;
schema.dictionary = nullptr;
schema.release = nullptr;
schema.private_data = nullptr;
return schema;
}
ArrowSchema schema; ArrowSchema create_nested_schema(const std::vector<ArrowSchema*>& arrays) {
schema.format = "+s"; auto children = static_cast<ArrowSchema**>(malloc(sizeof(ArrowSchema*) * arrays.size()));
schema.name = nullptr; for (size_t i = 0; i < arrays.size(); ++i) {
schema.metadata = nullptr; auto child = static_cast<ArrowSchema*>(malloc(sizeof(ArrowSchema)));
schema.flags = 0; *child = *arrays[i];
schema.n_children = static_cast<int64_t>(arrays.size()); children[i] = child;
schema.children = children;
schema.dictionary = nullptr;
schema.release = &release_schema;
schema.private_data = nullptr;
return schema;
} }
};
ArrowSchema schema;
schema.format = "+s";
schema.name = nullptr;
schema.metadata = nullptr;
schema.flags = 0;
schema.n_children = static_cast<int64_t>(arrays.size());
schema.children = children;
schema.dictionary = nullptr;
schema.release = &release_schema;
schema.private_data = nullptr;
return schema;
}
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
/* TESTS */ /* TESTS */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment