"git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "d84e9a2e5526bbb08bd901bc8d1c3ce528d68b85"
Commit 1b3deb5f authored by Jeff Daily's avatar Jeff Daily
Browse files

Revert "Fix error in cpp_tests/test_arrow.cpp."

This reverts commit e461e868.
parent e601565d
...@@ -148,18 +148,16 @@ class ArrowChunkedArrayTest : public testing::Test { ...@@ -148,18 +148,16 @@ class ArrowChunkedArrayTest : public testing::Test {
arr.private_data = nullptr; arr.private_data = nullptr;
return arr; return arr;
} }
};
/* ------------------------------------- SCHEMA CREATION ------------------------------------- */ /* ------------------------------------- SCHEMA CREATION ------------------------------------- */
template <typename T> template <typename T>
ArrowSchema create_primitive_schema() { ArrowSchema create_primitive_schema() {
std::logic_error("not implemented"); std::logic_error("not implemented");
} }
template <> template <>
ArrowSchema create_primitive_schema<float>() { ArrowSchema create_primitive_schema<float>() {
ArrowSchema schema; ArrowSchema schema;
schema.format = "f"; schema.format = "f";
schema.name = nullptr; schema.name = nullptr;
...@@ -171,10 +169,10 @@ ArrowSchema create_primitive_schema<float>() { ...@@ -171,10 +169,10 @@ ArrowSchema create_primitive_schema<float>() {
schema.release = nullptr; schema.release = nullptr;
schema.private_data = nullptr; schema.private_data = nullptr;
return schema; return schema;
} }
template <> template <>
ArrowSchema create_primitive_schema<bool>() { ArrowSchema create_primitive_schema<bool>() {
ArrowSchema schema; ArrowSchema schema;
schema.format = "b"; schema.format = "b";
schema.name = nullptr; schema.name = nullptr;
...@@ -186,9 +184,9 @@ ArrowSchema create_primitive_schema<bool>() { ...@@ -186,9 +184,9 @@ ArrowSchema create_primitive_schema<bool>() {
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) { ArrowSchema create_nested_schema(const std::vector<ArrowSchema*>& arrays) {
auto children = static_cast<ArrowSchema**>(malloc(sizeof(ArrowSchema*) * arrays.size())); auto children = static_cast<ArrowSchema**>(malloc(sizeof(ArrowSchema*) * arrays.size()));
for (size_t i = 0; i < arrays.size(); ++i) { for (size_t i = 0; i < arrays.size(); ++i) {
auto child = static_cast<ArrowSchema*>(malloc(sizeof(ArrowSchema))); auto child = static_cast<ArrowSchema*>(malloc(sizeof(ArrowSchema)));
...@@ -207,7 +205,8 @@ ArrowSchema create_nested_schema(const std::vector<ArrowSchema*>& arrays) { ...@@ -207,7 +205,8 @@ ArrowSchema create_nested_schema(const std::vector<ArrowSchema*>& arrays) {
schema.release = &release_schema; schema.release = &release_schema;
schema.private_data = nullptr; schema.private_data = nullptr;
return schema; 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