Skip to content

Commit 42c6799

Browse files
committed
Merge origin/main into update-schema
Resolved conflicts by accepting origin/main changes for: - src/iceberg/update/update_schema.h - src/iceberg/update/update_schema.cc - src/iceberg/table.h - src/iceberg/table.cc - src/iceberg/transaction.h - src/iceberg/transaction.cc - src/iceberg/update/pending_update.h The main branch includes a more complete implementation with ApplyChangesVisitor and additional features like ExpireSnapshots.
2 parents 85b52a3 + 2c53592 commit 42c6799

175 files changed

Lines changed: 12782 additions & 2387 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ jobs:
7777
shell: bash
7878
run: ci/scripts/build_example.sh $(pwd)/example
7979
windows:
80-
name: AMD64 Windows 2022
81-
runs-on: windows-2022
82-
timeout-minutes: 30
80+
name: AMD64 Windows 2025
81+
runs-on: windows-2025
82+
timeout-minutes: 60
8383
strategy:
8484
fail-fast: false
8585
steps:
@@ -89,11 +89,16 @@ jobs:
8989
shell: cmd
9090
run: |
9191
vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows cpr:x64-windows
92+
- name: Setup sccache
93+
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
9294
- name: Build Iceberg
9395
shell: cmd
96+
env:
97+
SCCACHE_GHA_ENABLED: "true"
9498
run: |
9599
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
96-
bash -c "ci/scripts/build_iceberg.sh $(pwd)"
100+
bash -c "ci/scripts/build_iceberg.sh $(pwd) OFF ON"
101+
sccache --show-stats
97102
- name: Build Example
98103
shell: cmd
99104
run: |

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ endif()
6969
include(CMakeParseArguments)
7070
include(IcebergBuildUtils)
7171
include(IcebergSanitizer)
72+
include(IcebergSccache)
7273
include(IcebergThirdpartyToolchain)
7374

7475
if(ICEBERG_BUILD_TESTS)

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ The following environment variables can be set to customize dependency URLs:
4343
- `ICEBERG_NANOARROW_URL`: Nanoarrow tarball URL
4444
- `ICEBERG_CROARING_URL`: CRoaring tarball URL
4545
- `ICEBERG_NLOHMANN_JSON_URL`: nlohmann-json tarball URL
46-
- `ICEBERG_SPDLOG_URL`: spdlog tarball URL
4746
- `ICEBERG_CPR_URL`: cpr tarball URL
4847

4948
Example usage:

ci/scripts/build_iceberg.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ set -eux
2222
source_dir=${1}
2323
build_dir=${1}/build
2424
build_rest_integration_test=${2:-OFF}
25+
build_enable_sccache=${3:-OFF}
2526

2627
mkdir ${build_dir}
2728
pushd ${build_dir}
@@ -45,6 +46,11 @@ else
4546
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Debug")
4647
fi
4748

49+
if [[ "${build_enable_sccache}" == "ON" ]]; then
50+
CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER_LAUNCHER=sccache")
51+
CMAKE_ARGS+=("-DCMAKE_C_COMPILER_LAUNCHER=sccache")
52+
fi
53+
4854
cmake "${CMAKE_ARGS[@]}" ${source_dir}
4955
if is_windows; then
5056
cmake --build . --config Release --target install

cmake_modules/IcebergBuildUtils.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ function(add_iceberg_lib LIB_NAME)
157157
hidden
158158
VISIBILITY_INLINES_HIDDEN 1)
159159

160+
if(MSVC_TOOLCHAIN)
161+
target_compile_options(${LIB_NAME}_shared PRIVATE /bigobj)
162+
endif()
163+
160164
install(TARGETS ${LIB_NAME}_shared
161165
EXPORT iceberg_targets
162166
ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR}
@@ -220,6 +224,10 @@ function(add_iceberg_lib LIB_NAME)
220224
target_compile_definitions(${LIB_NAME}_static PUBLIC ${VISIBILITY_NAME}_STATIC)
221225
endif()
222226

227+
if(MSVC_TOOLCHAIN)
228+
target_compile_options(${LIB_NAME}_static PRIVATE /bigobj)
229+
endif()
230+
223231
install(TARGETS ${LIB_NAME}_static
224232
EXPORT iceberg_targets
225233
ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR}

cmake_modules/IcebergSccache.cmake

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
if(MSVC_TOOLCHAIN AND "${CMAKE_CXX_COMPILER_LAUNCHER}" STREQUAL "sccache")
19+
message(STATUS "Configuring sccache for MSVC")
20+
21+
# Remove /Zi or /ZI
22+
string(REGEX REPLACE "/Z[iI]" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
23+
string(REGEX REPLACE "/Z[iI]" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
24+
25+
string(REGEX REPLACE "/Z[iI]" "" CMAKE_C_FLAGS_RELWITHDEBINFO
26+
"${CMAKE_C_FLAGS_RELWITHDEBINFO}")
27+
string(REGEX REPLACE "/Z[iI]" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO
28+
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
29+
30+
# Add /Z7
31+
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Z7")
32+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7")
33+
34+
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /Z7")
35+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Z7")
36+
endif()

cmake_modules/IcebergThirdpartyToolchain.cmake

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ set(ICEBERG_ARROW_INSTALL_INTERFACE_LIBS)
3131
# ICEBERG_NANOARROW_URL - Nanoarrow tarball URL
3232
# ICEBERG_CROARING_URL - CRoaring tarball URL
3333
# ICEBERG_NLOHMANN_JSON_URL - nlohmann-json tarball URL
34-
# ICEBERG_SPDLOG_URL - spdlog tarball URL
3534
# ICEBERG_CPR_URL - cpr tarball URL
3635
#
3736
# Example usage:
@@ -427,61 +426,6 @@ function(resolve_nlohmann_json_dependency)
427426
PARENT_SCOPE)
428427
endfunction()
429428

430-
# ----------------------------------------------------------------------
431-
# spdlog
432-
433-
function(resolve_spdlog_dependency)
434-
prepare_fetchcontent()
435-
436-
find_package(Threads REQUIRED)
437-
438-
set(SPDLOG_USE_STD_FORMAT
439-
ON
440-
CACHE BOOL "" FORCE)
441-
set(SPDLOG_BUILD_PIC
442-
ON
443-
CACHE BOOL "" FORCE)
444-
445-
if(DEFINED ENV{ICEBERG_SPDLOG_URL})
446-
set(SPDLOG_URL "$ENV{ICEBERG_SPDLOG_URL}")
447-
else()
448-
set(SPDLOG_URL "https://github.com/gabime/spdlog/archive/refs/tags/v1.15.3.tar.gz")
449-
endif()
450-
451-
fetchcontent_declare(spdlog
452-
${FC_DECLARE_COMMON_OPTIONS}
453-
URL ${SPDLOG_URL}
454-
FIND_PACKAGE_ARGS
455-
NAMES
456-
spdlog
457-
CONFIG)
458-
fetchcontent_makeavailable(spdlog)
459-
460-
if(spdlog_SOURCE_DIR)
461-
set_target_properties(spdlog PROPERTIES OUTPUT_NAME "iceberg_vendored_spdlog"
462-
POSITION_INDEPENDENT_CODE ON)
463-
target_link_libraries(spdlog INTERFACE Threads::Threads)
464-
install(TARGETS spdlog
465-
EXPORT iceberg_targets
466-
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
467-
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
468-
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
469-
set(SPDLOG_VENDORED TRUE)
470-
else()
471-
set(SPDLOG_VENDORED FALSE)
472-
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES spdlog)
473-
endif()
474-
475-
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Threads)
476-
477-
set(ICEBERG_SYSTEM_DEPENDENCIES
478-
${ICEBERG_SYSTEM_DEPENDENCIES}
479-
PARENT_SCOPE)
480-
set(SPDLOG_VENDORED
481-
${SPDLOG_VENDORED}
482-
PARENT_SCOPE)
483-
endfunction()
484-
485429
# ----------------------------------------------------------------------
486430
# zlib
487431

@@ -575,7 +519,6 @@ resolve_zlib_dependency()
575519
resolve_nanoarrow_dependency()
576520
resolve_croaring_dependency()
577521
resolve_nlohmann_json_dependency()
578-
resolve_spdlog_dependency()
579522

580523
if(ICEBERG_BUILD_BUNDLE)
581524
resolve_arrow_dependency()

example/demo_example.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "iceberg/arrow/arrow_file_io.h"
2323
#include "iceberg/avro/avro_register.h"
2424
#include "iceberg/catalog/memory/in_memory_catalog.h"
25+
#include "iceberg/manifest/manifest_entry.h"
2526
#include "iceberg/parquet/parquet_register.h"
2627
#include "iceberg/table.h"
2728
#include "iceberg/table_scan.h"

mkdocs/docs/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ We follow modern C++ best practices:
7373
- **C++23 Standard**: Use C++23 features where appropriate
7474
- **Naming Conventions**:
7575
- Classes: `PascalCase` (e.g., `TableScanBuilder`)
76-
- Functions: `snake_case` (e.g., `find_field_by_name`)
76+
- Functions/Methods: `PascalCase` (e.g., `CreateNamespace`, `ExtractYear`)
77+
- Trivial getters: `snake_case` (e.g., `name()`, `type_id()`, `is_primitive()`)
7778
- Variables: `snake_case` (e.g., `file_io`)
78-
- Constants: `UPPER_SNAKE_CASE` (e.g., `MAX_RETRIES`)
79+
- Constants: `k` prefix with `PascalCase` (e.g., `kHeaderContentType`, `kMaxPrecision`)
7980
- **Memory Management**: Prefer smart pointers (`std::unique_ptr`, `std::shared_ptr`)
8081
- **Error Handling**: Use `Result<T>` types for error propagation
8182
- **Documentation**: Use Doxygen-style comments for public APIs

src/iceberg/CMakeLists.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ set(ICEBERG_INCLUDES "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/src>"
2020
set(ICEBERG_SOURCES
2121
arrow_c_data_guard_internal.cc
2222
catalog/memory/in_memory_catalog.cc
23+
data/data_writer.cc
24+
data/equality_delete_writer.cc
25+
data/position_delete_writer.cc
2326
data/writer.cc
2427
delete_file_index.cc
2528
expression/aggregate.cc
@@ -40,8 +43,10 @@ set(ICEBERG_SOURCES
4043
file_writer.cc
4144
inheritable_metadata.cc
4245
json_internal.cc
46+
location_provider.cc
4347
manifest/manifest_adapter.cc
4448
manifest/manifest_entry.cc
49+
manifest/manifest_group.cc
4550
manifest/manifest_list.cc
4651
manifest/manifest_reader.cc
4752
manifest/manifest_writer.cc
@@ -79,7 +84,9 @@ set(ICEBERG_SOURCES
7984
transform.cc
8085
transform_function.cc
8186
type.cc
87+
update/expire_snapshots.cc
8288
update/pending_update.cc
89+
update/snapshot_update.cc
8390
update/update_partition_spec.cc
8491
update/update_properties.cc
8592
update/update_schema.cc
@@ -94,8 +101,10 @@ set(ICEBERG_SOURCES
94101
util/snapshot_util.cc
95102
util/temporal_util.cc
96103
util/timepoint.cc
104+
util/transform_util.cc
97105
util/truncate_util.cc
98106
util/type_util.cc
107+
util/url_encoder.cc
99108
util/uuid.cc)
100109

101110
set(ICEBERG_STATIC_BUILD_INTERFACE_LIBS)
@@ -108,27 +117,23 @@ list(APPEND
108117
nanoarrow::nanoarrow_static
109118
nlohmann_json::nlohmann_json
110119
roaring::roaring
111-
spdlog::spdlog
112120
ZLIB::ZLIB)
113121
list(APPEND
114122
ICEBERG_SHARED_BUILD_INTERFACE_LIBS
115123
nanoarrow::nanoarrow_shared
116124
nlohmann_json::nlohmann_json
117125
roaring::roaring
118-
spdlog::spdlog
119126
ZLIB::ZLIB)
120127
list(APPEND
121128
ICEBERG_STATIC_INSTALL_INTERFACE_LIBS
122129
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,iceberg::nanoarrow_static,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_static>,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>"
123130
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
124-
"$<IF:$<BOOL:${CROARING_VENDORED}>,iceberg::roaring,roaring::roaring>"
125-
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,iceberg::spdlog,spdlog::spdlog>")
131+
"$<IF:$<BOOL:${CROARING_VENDORED}>,iceberg::roaring,roaring::roaring>")
126132
list(APPEND
127133
ICEBERG_SHARED_INSTALL_INTERFACE_LIBS
128134
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,iceberg::nanoarrow_shared,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_shared>,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>"
129135
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
130-
"$<IF:$<BOOL:${CROARING_VENDORED}>,iceberg::roaring,roaring::roaring>"
131-
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,iceberg::spdlog,spdlog::spdlog>")
136+
"$<IF:$<BOOL:${CROARING_VENDORED}>,iceberg::roaring,roaring::roaring>")
132137

133138
add_iceberg_lib(iceberg
134139
SOURCES
@@ -159,8 +164,10 @@ add_subdirectory(util)
159164
if(ICEBERG_BUILD_BUNDLE)
160165
set(ICEBERG_BUNDLE_SOURCES
161166
arrow/arrow_fs_file_io.cc
167+
arrow/metadata_column_util.cc
162168
avro/avro_data_util.cc
163169
avro/avro_direct_decoder.cc
170+
avro/avro_direct_encoder.cc
164171
avro/avro_reader.cc
165172
avro/avro_writer.cc
166173
avro/avro_register.cc

0 commit comments

Comments
 (0)