Skip to content

Commit 49143c6

Browse files
committed
remove sparrow
1 parent 4b11571 commit 49143c6

File tree

5 files changed

+6
-103
lines changed

5 files changed

+6
-103
lines changed

cmake_modules/IcebergThirdpartyToolchain.cmake

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -210,18 +210,14 @@ endif()
210210
function(resolve_nanoarrow_dependency)
211211
prepare_fetchcontent()
212212

213-
set(NANOARROW_NAMESPACE
214-
"Iceberg"
215-
CACHE STRING "" FORCE)
216-
217213
fetchcontent_declare(nanoarrow
218214
${FC_DECLARE_COMMON_OPTIONS}
219215
URL "https://dlcdn.apache.org/arrow/apache-arrow-nanoarrow-0.6.0/apache-arrow-nanoarrow-0.6.0.tar.gz"
220216
)
221217
fetchcontent_makeavailable(nanoarrow)
222218

223-
set_target_properties(nanoarrow PROPERTIES OUTPUT_NAME "iceberg_vendored_nanoarrow")
224-
set_target_properties(nanoarrow PROPERTIES POSITION_INDEPENDENT_CODE ON)
219+
set_target_properties(nanoarrow PROPERTIES OUTPUT_NAME "iceberg_vendored_nanoarrow"
220+
POSITION_INDEPENDENT_CODE ON)
225221
install(TARGETS nanoarrow
226222
EXPORT iceberg_targets
227223
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
@@ -230,47 +226,3 @@ function(resolve_nanoarrow_dependency)
230226
endfunction()
231227

232228
resolve_nanoarrow_dependency()
233-
234-
# ----------------------------------------------------------------------
235-
# Sparrow
236-
237-
function(resolve_sparrow_dependency)
238-
prepare_fetchcontent()
239-
240-
# Add the sparrow cmake module path to the CMAKE_MODULE_PATH
241-
# Otherwise we will see error below:
242-
# include could not find requested file: sanitizers
243-
list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_BINARY_DIR}/_deps/sparrow-src/cmake)
244-
245-
if(MSVC_TOOLCHAIN)
246-
# MSVC does not support int128_t
247-
set(USE_LARGE_INT_PLACEHOLDERS ON)
248-
endif()
249-
250-
fetchcontent_declare(sparrow
251-
${FC_DECLARE_COMMON_OPTIONS}
252-
GIT_REPOSITORY https://github.com/man-group/sparrow.git
253-
GIT_TAG f2fdcadc07538d558f128e887257e2ac19610adf # 0.5.0
254-
)
255-
fetchcontent_makeavailable(sparrow)
256-
257-
set_target_properties(sparrow PROPERTIES OUTPUT_NAME "iceberg_vendored_sparrow")
258-
target_compile_definitions(sparrow INTERFACE SPARROW_USE_DATE_POLYFILL)
259-
if(MSVC_TOOLCHAIN)
260-
target_compile_definitions(sparrow INTERFACE SPARROW_USE_LARGE_INT_PLACEHOLDERS)
261-
endif()
262-
install(TARGETS sparrow
263-
EXPORT iceberg_targets
264-
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
265-
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
266-
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
267-
268-
# sparrow depends on date::date and date::date-tz. It is tricky to use FetchContent
269-
# to vendor date library since sparrow links date::date and date::date-tz directly.
270-
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES date)
271-
set(ICEBERG_SYSTEM_DEPENDENCIES
272-
${ICEBERG_SYSTEM_DEPENDENCIES}
273-
PARENT_SCOPE)
274-
endfunction()
275-
276-
# resolve_sparrow_dependency()

src/iceberg/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ set(ICEBERG_SHARED_BUILD_INTERFACE_LIBS)
2727
set(ICEBERG_STATIC_INSTALL_INTERFACE_LIBS)
2828
set(ICEBERG_SHARED_INSTALL_INTERFACE_LIBS)
2929

30-
# list(APPEND ICEBERG_STATIC_BUILD_INTERFACE_LIBS nanoarrow::nanoarrow sparrow)
31-
# list(APPEND ICEBERG_SHARED_BUILD_INTERFACE_LIBS nanoarrow::nanoarrow sparrow)
32-
# list(APPEND ICEBERG_STATIC_INSTALL_INTERFACE_LIBS "Iceberg::nanoarrow" "Iceberg::sparrow")
33-
# list(APPEND ICEBERG_SHARED_INSTALL_INTERFACE_LIBS "Iceberg::nanoarrow" "Iceberg::sparrow")
3430
list(APPEND ICEBERG_STATIC_BUILD_INTERFACE_LIBS nanoarrow::nanoarrow)
3531
list(APPEND ICEBERG_SHARED_BUILD_INTERFACE_LIBS nanoarrow::nanoarrow)
3632
list(APPEND ICEBERG_STATIC_INSTALL_INTERFACE_LIBS "Iceberg::nanoarrow")

src/iceberg/arrow_c_data_internal.cc

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@
1919

2020
#include "iceberg/arrow_c_data_internal.h"
2121

22-
#include <array>
2322
#include <string>
24-
#include <tuple>
25-
#include <vector>
26-
27-
// #include <sparrow/builder/builder.hpp>
2823

2924
namespace iceberg::internal {
3025

@@ -76,24 +71,4 @@ std::pair<ArrowSchema, ArrowArray> CreateExampleArrowSchemaAndArrayByNanoarrow()
7671
return {out_schema, out_array};
7772
}
7873

79-
// std::pair<ArrowSchema, ArrowArray> CreateExampleArrowSchemaAndArrayBySparrow() {
80-
// using struct_type = std::tuple<int64_t, sparrow::nullable<std::string>>;
81-
// std::vector<struct_type> values = {
82-
// {1, "a"},
83-
// {2, "b"},
84-
// {3, "c"},
85-
// };
86-
// auto sparrow_array = sparrow::build(values);
87-
88-
// // Demonstrate the use of arrow_proxy to modify the schema
89-
// auto [_, non_owning_schema] = sparrow::get_arrow_structures(sparrow_array);
90-
// non_owning_schema->children[0]->name = "id";
91-
// non_owning_schema->children[0]->flags &= ~ARROW_FLAG_NULLABLE;
92-
// non_owning_schema->children[1]->name = "name";
93-
// non_owning_schema->children[1]->flags |= ARROW_FLAG_NULLABLE;
94-
95-
// auto [array, schema] = sparrow::extract_arrow_structures(std::move(sparrow_array));
96-
// return {schema, array};
97-
// }
98-
9974
} // namespace iceberg::internal

src/iceberg/arrow_c_data_internal.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#pragma once
2121

2222
#include <nanoarrow/nanoarrow.hpp>
23-
// #include <sparrow/sparrow.hpp>
2423

2524
namespace iceberg::internal {
2625

@@ -31,11 +30,4 @@ namespace iceberg::internal {
3130
*/
3231
std::pair<ArrowSchema, ArrowArray> CreateExampleArrowSchemaAndArrayByNanoarrow();
3332

34-
// /**
35-
// * @brief Create a simple ArrowArray with non-nullable int64 and nullable string fields
36-
// *
37-
// * This is the example code to demonstrate the usage of sparrow API.
38-
// */
39-
// std::pair<ArrowSchema, ArrowArray> CreateExampleArrowSchemaAndArrayBySparrow();
40-
4133
} // namespace iceberg::internal

test/arrow/arrow_test.cc

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626

2727
namespace iceberg {
2828

29-
namespace {
29+
TEST(ArrowCDataTest, CheckArrowSchemaAndArrayByNanoarrow) {
30+
auto [schema, array] = internal::CreateExampleArrowSchemaAndArrayByNanoarrow();
3031

31-
void CheckArrowSchemaAndArray(ArrowSchema* schema, ArrowArray* array) {
32-
auto arrow_schema = ::arrow::ImportSchema(schema).ValueOrDie();
32+
auto arrow_schema = ::arrow::ImportSchema(&schema).ValueOrDie();
3333
EXPECT_EQ(arrow_schema->num_fields(), 2);
3434

3535
auto id_field = arrow_schema->field(0);
@@ -42,7 +42,7 @@ void CheckArrowSchemaAndArray(ArrowSchema* schema, ArrowArray* array) {
4242
EXPECT_EQ(name_field->type()->id(), ::arrow::Type::STRING);
4343
EXPECT_TRUE(name_field->nullable());
4444

45-
auto arrow_record_batch = ::arrow::ImportRecordBatch(array, arrow_schema).ValueOrDie();
45+
auto arrow_record_batch = ::arrow::ImportRecordBatch(&array, arrow_schema).ValueOrDie();
4646
EXPECT_EQ(arrow_record_batch->num_rows(), 3);
4747
EXPECT_EQ(arrow_record_batch->num_columns(), 2);
4848

@@ -59,16 +59,4 @@ void CheckArrowSchemaAndArray(ArrowSchema* schema, ArrowArray* array) {
5959
EXPECT_EQ(name_column->GetScalar(2).ValueOrDie()->ToString(), "c");
6060
}
6161

62-
} // namespace
63-
64-
TEST(ArrowCDataTest, CheckArrowSchemaAndArrayByNanoarrow) {
65-
auto [schema, array] = internal::CreateExampleArrowSchemaAndArrayByNanoarrow();
66-
CheckArrowSchemaAndArray(&schema, &array);
67-
}
68-
69-
// TEST(ArrowCDataTest, CheckArrowSchemaAndArrayBySparrow) {
70-
// auto [schema, array] = internal::CreateExampleArrowSchemaAndArrayBySparrow();
71-
// CheckArrowSchemaAndArray(&schema, &array);
72-
// }
73-
7462
} // namespace iceberg

0 commit comments

Comments
 (0)