Skip to content

Commit f36ce31

Browse files
committed
[Enhancement] Adapt BE to Arrow 24 (testing lib + json_simple removal)
Arrow 24 moved ArrayFromJSON out of the main library into libarrow_testing and removed arrow/ipc/json_simple.h. Adapt StarRocks: - build_arrow: enable ARROW_TESTING (depends only on ARROW_JSON, already on) with system GTest, so libarrow_testing.a is built and installed. - be/CMakeLists.txt: link arrow_testing (static; only the BE test binary that references ArrayFromJSON pulls it in, no production bloat). - column_to_arrow_converter_test.cpp: replace <arrow/ipc/json_simple.h> with <arrow/testing/gtest_util.h> and arrow::ipc::internal::json::ArrayFromJSON with arrow::ArrayFromJSON. Production BE compiles cleanly against Arrow 24 (verified to 57%+ incl. all column/arrow converters); this only touches a test + the thirdparty testing lib.
1 parent 7f3c3bd commit f36ce31

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

be/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ set(STARROCKS_DEPENDENCIES
649649
zstd
650650
streamvbyte
651651
arrow
652+
arrow_testing
652653
arrow_flight
653654
arrow_flight_sql
654655
gRPC::grpc

be/test/column/column_to_arrow_converter_test.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ DIAGNOSTIC_IGNORE("-Wclass-memaccess")
4242
DIAGNOSTIC_POP
4343
#endif
4444

45-
#include <arrow/ipc/json_simple.h>
45+
#include <arrow/testing/gtest_util.h>
4646
#include <arrow/memory_pool.h>
4747
#include <arrow/pretty_print.h>
4848

@@ -528,7 +528,7 @@ TEST_F(StarRocksColumnToArrowTest, testArrayColumn) {
528528
std::shared_ptr<arrow::Array> array;
529529
convert_to_arrow(array_type_desc, column, arrow_type, memory_pool.get(), &array);
530530

531-
auto s = arrow::ipc::internal::json::ArrayFromJSON(arrow_type, "[[1, 2, 3], [4, null, 5, 6], [], [null, null]]");
531+
auto s = arrow::ArrayFromJSON(arrow_type, "[[1, 2, 3], [4, null, 5, 6], [], [null, null]]");
532532
ASSERT_TRUE(s.ok());
533533
ASSERT_TRUE(s.ValueUnsafe()->Equals(array));
534534
}
@@ -554,7 +554,7 @@ TEST_F(StarRocksColumnToArrowTest, testNullableArrayColumn) {
554554
convert_to_arrow(array_type_desc, column, arrow_type, memory_pool.get(), &array);
555555

556556
std::shared_ptr<arrow::Array> expect_array;
557-
auto s = arrow::ipc::internal::json::ArrayFromJSON(arrow_type,
557+
auto s = arrow::ArrayFromJSON(arrow_type,
558558
"[[1, 2, 3], null, [4, null, 5, 6], [], [null, null]]");
559559
ASSERT_TRUE(s.ok());
560560
ASSERT_TRUE(s.ValueUnsafe()->Equals(array));
@@ -581,7 +581,7 @@ TEST_F(StarRocksColumnToArrowTest, testStructColumn) {
581581
std::shared_ptr<arrow::Array> array;
582582
convert_to_arrow(struct_type_desc, column, arrow_type, memory_pool.get(), &array);
583583

584-
auto s = arrow::ipc::internal::json::ArrayFromJSON(arrow_type, R"([
584+
auto s = arrow::ArrayFromJSON(arrow_type, R"([
585585
{"id": 1, "name": "test1"},
586586
{"id": null, "name": "test2"},
587587
{"id": 2, "name": null},
@@ -615,7 +615,7 @@ TEST_F(StarRocksColumnToArrowTest, testNullableStructColumn) {
615615
convert_to_arrow(struct_type_desc, column, arrow_type, memory_pool.get(), &array);
616616

617617
std::shared_ptr<arrow::Array> expect_array;
618-
auto s = arrow::ipc::internal::json::ArrayFromJSON(arrow_type, R"([
618+
auto s = arrow::ArrayFromJSON(arrow_type, R"([
619619
{"id": 1, "name": "test1"},
620620
null,
621621
{"id": null, "name": "test2"},

thirdparty/build-thirdparty.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ build_arrow() {
931931
# so disable jemalloc here and use SystemAllocator.
932932
#
933933
# Currently, the standard APIs are hooked in BE, so the jemalloc standard APIs will actually be used.
934-
${CMAKE_CMD} -DARROW_PARQUET=ON -DARROW_JSON=ON -DARROW_IPC=ON -DARROW_USE_GLOG=OFF -DARROW_BUILD_STATIC=ON -DARROW_BUILD_SHARED=OFF \
934+
${CMAKE_CMD} -DARROW_TESTING=ON -DGTest_SOURCE=SYSTEM -DGTest_ROOT=$TP_INSTALL_DIR -DARROW_PARQUET=ON -DARROW_JSON=ON -DARROW_IPC=ON -DARROW_USE_GLOG=OFF -DARROW_BUILD_STATIC=ON -DARROW_BUILD_SHARED=OFF \
935935
-DARROW_WITH_BROTLI=ON -DARROW_WITH_LZ4=ON -DARROW_WITH_SNAPPY=ON -DARROW_WITH_ZLIB=ON -DARROW_WITH_ZSTD=ON \
936936
-DARROW_WITH_UTF8PROC=OFF -DARROW_WITH_RE2=OFF \
937937
-DARROW_JEMALLOC=OFF -DARROW_MIMALLOC=OFF \

0 commit comments

Comments
 (0)