Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
1b3deb5f
Commit
1b3deb5f
authored
Sep 23, 2025
by
Jeff Daily
Browse files
Revert "Fix error in cpp_tests/test_arrow.cpp."
This reverts commit
e461e868
.
parent
e601565d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
53 deletions
+52
-53
tests/cpp_tests/test_arrow.cpp
tests/cpp_tests/test_arrow.cpp
+52
-53
No files found.
tests/cpp_tests/test_arrow.cpp
View file @
1b3deb5f
...
@@ -148,66 +148,65 @@ class ArrowChunkedArrayTest : public testing::Test {
...
@@ -148,66 +148,65 @@ class ArrowChunkedArrayTest : public testing::Test {
arr
.
private_data
=
nullptr
;
arr
.
private_data
=
nullptr
;
return
arr
;
return
arr
;
}
}
};
/* ------------------------------------- SCHEMA CREATION ------------------------------------- */
/* ------------------------------------- SCHEMA CREATION ------------------------------------- */
template
<
typename
T
>
ArrowSchema
create_primitive_schema
()
{
std
::
logic_error
(
"not implemented"
);
}
template
<
typename
T
>
template
<
>
ArrowSchema
create_primitive_schema
()
{
ArrowSchema
create_primitive_schema
<
float
>
()
{
std
::
logic_error
(
"not implemented"
);
ArrowSchema
schema
;
}
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
<
float
>
()
{
ArrowSchema
create_primitive_schema
<
bool
>
()
{
ArrowSchema
schema
;
ArrowSchema
schema
;
schema
.
format
=
"
f
"
;
schema
.
format
=
"
b
"
;
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
;
}
}
template
<
>
ArrowSchema
create_nested_schema
(
const
std
::
vector
<
ArrowSchema
*>&
arrays
)
{
ArrowSchema
create_primitive_schema
<
bool
>
()
{
auto
children
=
static_cast
<
ArrowSchema
**>
(
malloc
(
sizeof
(
ArrowSchema
*
)
*
arrays
.
size
()));
ArrowSchema
schema
;
for
(
size_t
i
=
0
;
i
<
arrays
.
size
();
++
i
)
{
schema
.
format
=
"b"
;
auto
child
=
static_cast
<
ArrowSchema
*>
(
malloc
(
sizeof
(
ArrowSchema
)));
schema
.
name
=
nullptr
;
*
child
=
*
arrays
[
i
];
schema
.
metadata
=
nullptr
;
children
[
i
]
=
child
;
schema
.
flags
=
0
;
}
schema
.
n_children
=
0
;
schema
.
children
=
nullptr
;
schema
.
dictionary
=
nullptr
;
schema
.
release
=
nullptr
;
schema
.
private_data
=
nullptr
;
return
schema
;
}
ArrowSchema
create_nested_schema
(
const
std
::
vector
<
ArrowSchema
*>&
arrays
)
{
ArrowSchema
schema
;
auto
children
=
static_cast
<
ArrowSchema
**>
(
malloc
(
sizeof
(
ArrowSchema
*
)
*
arrays
.
size
()));
schema
.
format
=
"+s"
;
for
(
size_t
i
=
0
;
i
<
arrays
.
size
();
++
i
)
{
schema
.
name
=
nullptr
;
auto
child
=
static_cast
<
ArrowSchema
*>
(
malloc
(
sizeof
(
ArrowSchema
)));
schema
.
metadata
=
nullptr
;
*
child
=
*
arrays
[
i
];
schema
.
flags
=
0
;
children
[
i
]
=
child
;
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
;
}
}
};
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 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment