Skip to content

[c++] Add c++ support for Array data type#501

Open
charlesdong1991 wants to merge 9 commits intoapache:mainfrom
charlesdong1991:issue-468/cpp-support
Open

[c++] Add c++ support for Array data type#501
charlesdong1991 wants to merge 9 commits intoapache:mainfrom
charlesdong1991:issue-468/cpp-support

Conversation

@charlesdong1991
Copy link
Copy Markdown
Contributor

@charlesdong1991 charlesdong1991 commented Apr 18, 2026

Purpose

Linked issue: close #468

Brief change log

  • Adds ARRAY data type support to the C++ bindings and cover full write and read paths (by creating ArrayWriter and ArrayView, also expose in public api)
  • Support nested arrays on both write and read
  • Extend GenericRow, RowView and LookupResult with array-typed getters and setters

Tests

All tests are passed

API and Format

Documentation

@charlesdong1991 charlesdong1991 marked this pull request as draft April 18, 2026 12:13
@charlesdong1991 charlesdong1991 marked this pull request as ready for review April 18, 2026 12:56
@charlesdong1991
Copy link
Copy Markdown
Contributor Author

@fresh-borzoni @leekeiabstraction appreciate it a lot if you can take a look! 🙏 thanks!

Copy link
Copy Markdown
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

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

TY for the PR. Left early comments.

Comment thread bindings/cpp/src/table.cpp
Comment thread bindings/cpp/src/table.cpp
Copy link
Copy Markdown
Contributor

@fresh-borzoni fresh-borzoni left a comment

Choose a reason for hiding this comment

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

@charlesdong1991 Ty, looks good in general, added minor comments, PTAL

/// itself an array) is deep-copied into a shared owning handle so that
/// copies of the outer DataType remain cheap while the element lives
/// as long as any reference exists.
static DataType Array(DataType element) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we add element nullability?

Rust's ArrayType::with_nullable(false, e) carries it, by dropping here we silently lose ARRAY on schema round-trip. Probably the same applies to python, do you mind to check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good observation, with another look, it seems nullability is actually not in place for every data type, not limited to Array. The same with python.

I suggest create a separate issue to fix nullability instead, and focus on supporting array type in this PR.

WDYT? If you agree, i can create 2 issues for python and c++ @fresh-borzoni

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure, it works

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created 2 issues

Comment thread bindings/cpp/include/fluss.hpp
Comment thread bindings/cpp/include/fluss.hpp Outdated
Comment thread bindings/cpp/src/ffi_converter.hpp
Comment thread bindings/cpp/include/fluss.hpp
Comment thread bindings/cpp/test/test_log_table.cpp
Copy link
Copy Markdown
Contributor

@fresh-borzoni fresh-borzoni left a comment

Choose a reason for hiding this comment

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

@charlesdong1991 Ty for the great work! LGTM 👍

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.

[c++] Add Array data support for c++ binding

3 participants