Skip to content

Commit fc65a8b

Browse files
authored
Merge branch 'main' into support_manifest_list_reader
2 parents d77b8f2 + be514fc commit fc65a8b

34 files changed

+519
-3130
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ project(Iceberg
2828
DESCRIPTION "Iceberg C++ Project"
2929
LANGUAGES CXX)
3030

31-
set(CMAKE_CXX_STANDARD 20)
31+
set(CMAKE_CXX_STANDARD 23)
3232
set(CMAKE_CXX_STANDARD_REQUIRED ON)
3333
set(CMAKE_CXX_EXTENSIONS OFF)
3434
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

LICENSE

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -202,34 +202,6 @@
202202

203203
--------------------------------------------------------------------------------
204204

205-
The file src/iceberg/expected.h contains code adapted from
206-
207-
https://github.com/zeus-cpp/expected
208-
209-
with the following license (MIT)
210-
211-
Copyright (c) 2024 zeus-cpp
212-
213-
Permission is hereby granted, free of charge, to any person obtaining a copy
214-
of this software and associated documentation files (the "Software"), to deal
215-
in the Software without restriction, including without limitation the rights
216-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
217-
copies of the Software, and to permit persons to whom the Software is
218-
furnished to do so, subject to the following conditions:
219-
220-
The above copyright notice and this permission notice shall be included in all
221-
copies or substantial portions of the Software.
222-
223-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
224-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
225-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
226-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
227-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
228-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
229-
SOFTWARE.
230-
231-
--------------------------------------------------------------------------------
232-
233205
3rdparty dependency nlohmann-json is statically linked in certain binary
234206
distributions. nlohmann-json has the following license:
235207

NOTICE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ Copyright 2024-2025 The Apache Software Foundation
44
This product includes software developed at
55
The Apache Software Foundation (http://www.apache.org/).
66

7-
This product includes code from zeus-cpp
8-
* Copyright (c) 2024 zeus-cpp
9-
* https://github.com/zeus-cpp/expected
10-
117
This product includes code from smhasher
128
* MurmurHash3 was written by Austin Appleby, and is placed in the public
139
* domain. The author hereby disclaims copyright to this source code.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ C++ implementation of [Apache Iceberg™](https://iceberg.apache.org/).
2424
## Requirements
2525

2626
- CMake 3.25 or higher
27-
- C++20 compliant compiler
27+
- C++23 compliant compiler
2828

2929
## Build
3030

cmake_modules/IcebergThirdpartyToolchain.cmake

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function(resolve_arrow_dependency)
9999
fetchcontent_declare(VendoredArrow
100100
${FC_DECLARE_COMMON_OPTIONS}
101101
GIT_REPOSITORY https://github.com/apache/arrow.git
102-
GIT_TAG 5f0aeb5de53fb25b59a52661a80071faef99a4a4
102+
GIT_TAG f12356adaaabea86638407e995e73215dbb58bb2
103103
#URL ${ARROW_SOURCE_URL}
104104
#URL_HASH "SHA256=${ICEBERG_ARROW_BUILD_SHA256_CHECKSUM}"
105105
SOURCE_SUBDIR
@@ -282,6 +282,55 @@ function(resolve_nlohmann_json_dependency)
282282
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
283283
endfunction()
284284

285+
# ----------------------------------------------------------------------
286+
# spdlog
287+
288+
function(resolve_spdlog_dependency)
289+
prepare_fetchcontent()
290+
291+
find_package(Threads REQUIRED)
292+
293+
set(SPDLOG_USE_STD_FORMAT
294+
ON
295+
CACHE BOOL "" FORCE)
296+
set(SPDLOG_BUILD_PIC
297+
ON
298+
CACHE BOOL "" FORCE)
299+
300+
fetchcontent_declare(spdlog
301+
${FC_DECLARE_COMMON_OPTIONS}
302+
URL "https://github.com/gabime/spdlog/archive/refs/tags/v1.15.3.tar.gz"
303+
FIND_PACKAGE_ARGS
304+
NAMES
305+
spdlog
306+
CONFIG)
307+
fetchcontent_makeavailable(spdlog)
308+
309+
if(spdlog_SOURCE_DIR)
310+
set_target_properties(spdlog PROPERTIES OUTPUT_NAME "iceberg_vendored_spdlog"
311+
POSITION_INDEPENDENT_CODE ON)
312+
target_link_libraries(spdlog INTERFACE Threads::Threads)
313+
install(TARGETS spdlog
314+
EXPORT iceberg_targets
315+
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
316+
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
317+
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
318+
set(SPDLOG_VENDORED TRUE)
319+
else()
320+
set(SPDLOG_VENDORED FALSE)
321+
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES spdlog)
322+
endif()
323+
324+
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Threads)
325+
326+
set(ICEBERG_SYSTEM_DEPENDENCIES
327+
${ICEBERG_SYSTEM_DEPENDENCIES}
328+
PARENT_SCOPE)
329+
set(SPDLOG_VENDORED
330+
${SPDLOG_VENDORED}
331+
PARENT_SCOPE)
332+
endfunction()
333+
285334
# ----------------------------------------------------------------------
286335
# zlib
287336

@@ -316,6 +365,7 @@ endfunction()
316365
resolve_zlib_dependency()
317366
resolve_nanoarrow_dependency()
318367
resolve_nlohmann_json_dependency()
368+
resolve_spdlog_dependency()
319369

320370
if(ICEBERG_BUILD_BUNDLE)
321371
resolve_arrow_dependency()

example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cmake_minimum_required(VERSION 3.25)
2020

2121
project(example)
2222

23-
set(CMAKE_CXX_STANDARD 20)
23+
set(CMAKE_CXX_STANDARD 23)
2424

2525
find_package(Iceberg CONFIG REQUIRED)
2626

src/iceberg/CMakeLists.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ set(ICEBERG_SOURCES
4040
statistics_file.cc
4141
table.cc
4242
table_metadata.cc
43+
table_scan.cc
4344
transform.cc
4445
transform_function.cc
4546
type.cc
@@ -48,7 +49,6 @@ set(ICEBERG_SOURCES
4849
arrow_c_data_guard_internal.cc
4950
util/murmurhash3_internal.cc
5051
util/timepoint.cc
51-
util/unreachable.cc
5252
util/gzip_internal.cc)
5353

5454
set(ICEBERG_STATIC_BUILD_INTERFACE_LIBS)
@@ -60,16 +60,24 @@ list(APPEND
6060
ICEBERG_STATIC_BUILD_INTERFACE_LIBS
6161
nanoarrow::nanoarrow
6262
nlohmann_json::nlohmann_json
63+
spdlog::spdlog
6364
ZLIB::ZLIB)
6465
list(APPEND
6566
ICEBERG_SHARED_BUILD_INTERFACE_LIBS
6667
nanoarrow::nanoarrow
6768
nlohmann_json::nlohmann_json
69+
spdlog::spdlog
6870
ZLIB::ZLIB)
69-
list(APPEND ICEBERG_STATIC_INSTALL_INTERFACE_LIBS "Iceberg::nanoarrow"
70-
"Iceberg::nlohmann_json")
71-
list(APPEND ICEBERG_SHARED_INSTALL_INTERFACE_LIBS "Iceberg::nanoarrow"
72-
"Iceberg::nlohmann_json")
71+
list(APPEND
72+
ICEBERG_STATIC_INSTALL_INTERFACE_LIBS
73+
"Iceberg::nanoarrow"
74+
"Iceberg::nlohmann_json"
75+
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,Iceberg::spdlog,spdlog::spdlog>")
76+
list(APPEND
77+
ICEBERG_SHARED_INSTALL_INTERFACE_LIBS
78+
"Iceberg::nanoarrow"
79+
"Iceberg::nlohmann_json"
80+
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,Iceberg::spdlog,spdlog::spdlog>")
7381

7482
add_iceberg_lib(iceberg
7583
SOURCES

src/iceberg/arrow/arrow_error_transform_internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ inline ErrorKind ToErrorKind(const ::arrow::Status& status) {
3838
#define ICEBERG_ARROW_ASSIGN_OR_RETURN_IMPL(result_name, lhs, rexpr, error_transform) \
3939
auto&& result_name = (rexpr); \
4040
if (!result_name.ok()) { \
41-
return unexpected<Error>{{.kind = error_transform(result_name.status()), \
42-
.message = result_name.status().ToString()}}; \
41+
return std::unexpected<Error>{{.kind = error_transform(result_name.status()), \
42+
.message = result_name.status().ToString()}}; \
4343
} \
4444
lhs = std::move(result_name).ValueOrDie();
4545

@@ -51,7 +51,7 @@ inline ErrorKind ToErrorKind(const ::arrow::Status& status) {
5151
do { \
5252
auto&& _status = (expr); \
5353
if (!_status.ok()) { \
54-
return unexpected<Error>{ \
54+
return std::unexpected<Error>{ \
5555
{.kind = ToErrorKind(_status), .message = _status.ToString()}}; \
5656
} \
5757
} while (0)

src/iceberg/avro/avro_reader.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ class AvroReader::Impl {
227227
std::unique_ptr<ReadContext> context_;
228228
};
229229

230+
AvroReader::~AvroReader() = default;
231+
230232
Result<std::optional<ArrowArray>> AvroReader::Next() { return impl_->Next(); }
231233

232234
Result<ArrowSchema> AvroReader::Schema() { return impl_->Schema(); }

src/iceberg/avro/avro_reader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ICEBERG_BUNDLE_EXPORT AvroReader : public Reader {
2929
public:
3030
AvroReader() = default;
3131

32-
~AvroReader() override = default;
32+
~AvroReader() override;
3333

3434
Status Open(const ReaderOptions& options) final;
3535

0 commit comments

Comments
 (0)