Skip to content

build(arrow): upgrade to 26.0.1 and require C++20 - #598

Open
SteNicholas wants to merge 1 commit into
apache:mainfrom
SteNicholas:PAIMON-596
Open

SteNicholas wants to merge 1 commit into
apache:mainfrom
SteNicholas:PAIMON-596

Conversation

@SteNicholas

@SteNicholas SteNicholas commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Purpose

Linked issue: close #596

Upgrade bundled Arrow and Parquet from 17.0.0 to 26.0.1 for the upstream APIs needed by Parquet geospatial support. Paimon source builds require C++20 and CMake 3.26 or later. The installed public API continues to support C++17.

  • Pin the Arrow source archive by SHA-256 and build bundled Boost 1.66 in C++17 mode for Lucene++.
  • Port the Parquet patches to Arrow 26 and register compute kernels in static builds. Keep asynchronous prefetch and skip empty row groups during reads.
  • Use Arrow 26's per-key sort options to preserve null-first ordering. Preserve the minimum nanosecond timestamp and reject values outside the representable range.
  • Include the ORC file URI when decoding embedded Arrow schema metadata fails.
  • Retire the GCC 8 workflow and add a C++17 installed-package smoke test to the GCC 14 release job.

The Parquet benchmarks used Release builds and identical settings on the same macOS arm64 host. Each time is the mean of two run medians, with seven repetitions per run.

Workload Arrow 17.0.0 (ms) Arrow 26.0.1 (ms) Elapsed time change
Full scan 2.023 1.953 −3.5%
Filtered scan with page index 0.669 0.633 −5.4%
Uncompressed write 7.866 7.200 −8.5%
Snappy write 8.046 7.913 −1.6%
Zstandard write 9.165 8.831 −3.6%

Tests

  • Installed-package smoke test for a C++17 consumer that includes paimon/schema/schema.h and passes an ArrowSchema through the public API.
  • Arrow stream adapter tests for asynchronous short reads, EOF handling and buffer lifetime.
  • Parquet tests for empty row groups, byte-based page sizing, page indexes, standard column statistics and Variant round-trips. Primary-key integration coverage verifies full compaction after schema evolution.
  • ORC tests for nested field metadata round-trips and file URIs in decoding errors.
  • Casting tests for non-UTF-8 bytes in binary and string arrays and for nanosecond timestamp bounds. Release download tests cover checksum verification across fallback URLs.

API and Format

  • Use Paimon's Arrow C Data Interface definitions in installed headers so C++17 consumers can exchange Arrow data with Paimon.
  • Retain byte-based Parquet page sizing, configurable page indexes and standard column statistics. Keep optional size statistics disabled to match Arrow 17 writes.

Documentation

Yes. CONTRIBUTING.md and docs/source/building.rst document the source-build requirements. docs/source/build_system.rst explains C++17 consumer integration and uses C++20 for the Arrow C++ example.

Generative AI tooling

Generated-by: OpenAI Codex 0.170.0

🤖 Generated with OpenAI Codex

@SteNicholas
SteNicholas force-pushed the PAIMON-596 branch 5 times, most recently from 7e2ef71 to 1e5d99e Compare November 26, 2026 00:29
Parquet geospatial support needs upstream APIs available in Arrow 26.
The upgrade requires C++20 for source builds. Installed Paimon
consumers can still use C++17 and exchange columnar data through the
Arrow C Data Interface.

- Upgrade bundled Arrow and Parquet to 26.0.1. Require C++20 and CMake
  3.26 for source builds, retire GCC 8 CI and update the build guides,
  addressing apache#596.
- Keep Arrow C++ headers out of the public API. Compile, link and run a
  C++17 consumer against the installed Paimon package in CI.
- Port the Parquet patches and register compute kernels in static Arrow
  builds. Keep asynchronous prefetch, byte-based page sizing and the
  page-index setting. Skip empty row groups on read and omit the new
  size statistics on write.
- Report Arrow schema decoding failures in ORC with the file URI.
  Check nested field metadata and migrate test fixtures to Arrow's
  public JSON API.
@lucasfang

Copy link
Copy Markdown
Member

I suggest removing paimon/arrow/abi.h and keeping only forward declarations in the public API headers. Users who need the complete definitions can explicitly include their Arrow ABI header.

Our copy shares the ARROW_C_DATA_INTERFACE guard with upstream Arrow. If included first, it can suppress newer definitions, such as Arrow 26’s ARROW_STATISTICS_KEY_* macros, making them unavailable to users.

ReadContext::HasReadSchema() would need to move to the implementation file because it accesses an ArrowSchema field.

# under the License.

name: Gcc 8 Test

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This GCC 8 CI was originally added by @SGZW in alibaba/paimon-cpp#194 to catch compatibility regressions. The Arrow upgrade now requires C++20. Could you assess whether we can drop GCC 8 support and remove this workflow?

PAIMON_RETURN_NOT_OK_FROM_ARROW(sequences.Finish(&sequence_array));
constexpr int32_t kSequenceNumberColumn = 0;
arrow::ArrayVector columns = {std::move(sequence_array), std::move(kind_array)};
columns.insert(columns.end(), values->fields().begin(), values->fields().end());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is switching the sequence sort key from its name to index 0 necessary for the Arrow upgrade? Other keys still use names; could we keep the existing name-based reference for consistency?

ASSERT_FALSE(HasExtraLookupFiles(write_msgs_p0));
ASSERT_OK(Commit(table_path, write_msgs_p0));
ASSERT_OK_AND_ASSIGN(auto write_msgs, WriteArray(table_path, partition_0, 0, array,
commit_id, true, {}, false));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep comments like /*row_kinds=*/{}; otherwise it’s hard to understand the call parameters.

ASSERT_TRUE(result_array->Equals(*expected_array));
ASSERT_TRUE(result_array->Equals(*expected_array))
<< "Actual: " << result_array->ToString()
<< "Expected: " << expected_array->ToString();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this debug code be removed?

return ToArrowStatus(read_bytes.status());
}
if (storage_read_bytes_) {
storage_read_bytes_->fetch_add(static_cast<uint64_t>(read_bytes.value()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed you removed the null-check for storage_read_bytes_ in ReadAsync(). Assuming the internal member is never null, that’s fine. But please also align the null-check behavior in the other functions like Read() and ReadAt().

@lxy-9602

Copy link
Copy Markdown
Member

Thanks for upgrading the Arrow version! @zjw1111 is running some read/write performance regressions now—let’s wait for his results.

Comment thread cmake_modules/arrow.diff
Comment on lines +1124 to +1141
diff --git a/cpp/src/arrow/util/value_parsing.h b/cpp/src/arrow/util/value_parsing.h
--- a/cpp/src/arrow/util/value_parsing.h
+++ b/cpp/src/arrow/util/value_parsing.h
@@ -793,7 +793,13 @@ static inline bool ParseTimestampISO8601(const char* s, size_t length,
if (ARROW_PREDICT_FALSE(!util::CastSecondsToUnit(unit, count, out))) {
- return false;
+ if (count >= 0 || subseconds == 0 ||
+ !util::CastSecondsToUnit(unit, count + 1, out)) {
+ return false;
+ }
+ const auto units_per_second = *util::CastSecondsToUnit(unit, 1);
+ return !::arrow::internal::AddWithOverflow(
+ *out, static_cast<int64_t>(subseconds) - units_per_second, out);
}
if (ARROW_PREDICT_FALSE(::arrow::internal::AddWithOverflow(*out, subseconds, out))) {
return false;
}
return true;

@zjw1111 zjw1111 Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we drop this patch and use a near-boundary nanosecond value that upstream Arrow accepts in the casting test? Other Arrow versions may still reject INT64_MIN, so testing that exact value would make the test depend on Paimon's patched parser.

Comment thread cmake_modules/arrow.diff
Comment on lines +704 to +706
+ if (planned_data_page != nullptr) {
+ ++next_data_page_;
+ }

@zjw1111 zjw1111 Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch looks unreachable because the read plan and data_page_filter are mutually exclusive and planned non-data pages are rejected above. Did a specific test fail without this increment, or was this a defensive check suggested by AI?

ASSERT_NO_FATAL_FAILURE(write_file(batch_count, all_null_value,
DEFAULT_PARQUET_WRITER_MAX_MEMORY_USE, &default_limit));
EXPECT_GT(limited.row_group_count, default_limit.row_group_count);
EXPECT_LT(limited.peak_memory, default_limit.peak_memory);

@zjw1111 zjw1111 Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also check the writer's peak memory against the configured threshold? For example, the old test checked that the peak was between 1 and 1.5 times the threshold. The current comparison can still pass if both peaks rise, so an explicit range would help catch future regressions in memory control.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Upgrade to Arrow 26.0.1 with C++20 builds and a C++17-compatible public API

4 participants