Skip to content

Commit e461e86

Browse files
committed
Fix error in cpp_tests/test_arrow.cpp.
error: explicit specialization in non-namespace scope ‘class ArrowChunkedArrayTest’
1 parent 61ec4f1 commit e461e86

File tree

1 file changed

+53
-52
lines changed

1 file changed

+53
-52
lines changed

tests/cpp_tests/test_arrow.cpp

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -148,65 +148,66 @@ class ArrowChunkedArrayTest : public testing::Test {
148148
arr.private_data = nullptr;
149149
return arr;
150150
}
151+
};
151152

152-
/* ------------------------------------- SCHEMA CREATION ------------------------------------- */
153153

154-
template <typename T>
155-
ArrowSchema create_primitive_schema() {
156-
std::logic_error("not implemented");
157-
}
154+
/* ------------------------------------- SCHEMA CREATION ------------------------------------- */
158155

159-
template <>
160-
ArrowSchema create_primitive_schema<float>() {
161-
ArrowSchema schema;
162-
schema.format = "f";
163-
schema.name = nullptr;
164-
schema.metadata = nullptr;
165-
schema.flags = 0;
166-
schema.n_children = 0;
167-
schema.children = nullptr;
168-
schema.dictionary = nullptr;
169-
schema.release = nullptr;
170-
schema.private_data = nullptr;
171-
return schema;
172-
}
156+
template <typename T>
157+
ArrowSchema create_primitive_schema() {
158+
std::logic_error("not implemented");
159+
}
173160

174-
template <>
175-
ArrowSchema create_primitive_schema<bool>() {
176-
ArrowSchema schema;
177-
schema.format = "b";
178-
schema.name = nullptr;
179-
schema.metadata = nullptr;
180-
schema.flags = 0;
181-
schema.n_children = 0;
182-
schema.children = nullptr;
183-
schema.dictionary = nullptr;
184-
schema.release = nullptr;
185-
schema.private_data = nullptr;
186-
return schema;
187-
}
161+
template <>
162+
ArrowSchema create_primitive_schema<float>() {
163+
ArrowSchema schema;
164+
schema.format = "f";
165+
schema.name = nullptr;
166+
schema.metadata = nullptr;
167+
schema.flags = 0;
168+
schema.n_children = 0;
169+
schema.children = nullptr;
170+
schema.dictionary = nullptr;
171+
schema.release = nullptr;
172+
schema.private_data = nullptr;
173+
return schema;
174+
}
188175

189-
ArrowSchema create_nested_schema(const std::vector<ArrowSchema*>& arrays) {
190-
auto children = static_cast<ArrowSchema**>(malloc(sizeof(ArrowSchema*) * arrays.size()));
191-
for (size_t i = 0; i < arrays.size(); ++i) {
192-
auto child = static_cast<ArrowSchema*>(malloc(sizeof(ArrowSchema)));
193-
*child = *arrays[i];
194-
children[i] = child;
195-
}
176+
template <>
177+
ArrowSchema create_primitive_schema<bool>() {
178+
ArrowSchema schema;
179+
schema.format = "b";
180+
schema.name = nullptr;
181+
schema.metadata = nullptr;
182+
schema.flags = 0;
183+
schema.n_children = 0;
184+
schema.children = nullptr;
185+
schema.dictionary = nullptr;
186+
schema.release = nullptr;
187+
schema.private_data = nullptr;
188+
return schema;
189+
}
196190

197-
ArrowSchema schema;
198-
schema.format = "+s";
199-
schema.name = nullptr;
200-
schema.metadata = nullptr;
201-
schema.flags = 0;
202-
schema.n_children = static_cast<int64_t>(arrays.size());
203-
schema.children = children;
204-
schema.dictionary = nullptr;
205-
schema.release = &release_schema;
206-
schema.private_data = nullptr;
207-
return schema;
191+
ArrowSchema create_nested_schema(const std::vector<ArrowSchema*>& arrays) {
192+
auto children = static_cast<ArrowSchema**>(malloc(sizeof(ArrowSchema*) * arrays.size()));
193+
for (size_t i = 0; i < arrays.size(); ++i) {
194+
auto child = static_cast<ArrowSchema*>(malloc(sizeof(ArrowSchema)));
195+
*child = *arrays[i];
196+
children[i] = child;
208197
}
209-
};
198+
199+
ArrowSchema schema;
200+
schema.format = "+s";
201+
schema.name = nullptr;
202+
schema.metadata = nullptr;
203+
schema.flags = 0;
204+
schema.n_children = static_cast<int64_t>(arrays.size());
205+
schema.children = children;
206+
schema.dictionary = nullptr;
207+
schema.release = &release_schema;
208+
schema.private_data = nullptr;
209+
return schema;
210+
}
210211

211212
/* --------------------------------------------------------------------------------------------- */
212213
/* TESTS */

0 commit comments

Comments
 (0)