Skip to content

[cpp] Encode CreateTable column types losslessly#638

Open
fresh-borzoni wants to merge 1 commit into
apache:mainfrom
fresh-borzoni:fix/cpp-create-table-native-schema
Open

[cpp] Encode CreateTable column types losslessly#638
fresh-borzoni wants to merge 1 commit into
apache:mainfrom
fresh-borzoni:fix/cpp-create-table-native-schema

Conversation

@fresh-borzoni

Copy link
Copy Markdown
Member

closes #637

Now the column types go to the server natively and are stored exactly as declared.

@fresh-borzoni

Copy link
Copy Markdown
Member Author

@charlesdong1991 @leekeiabstraction PTAL, pls

@fresh-borzoni fresh-borzoni force-pushed the fix/cpp-create-table-native-schema branch from cd3399a to 2bea13b Compare June 24, 2026 16:28
@fresh-borzoni

Copy link
Copy Markdown
Member Author

@loserwang1024 @naivedogger Since you expressed an interest in C++ bindings PTAL :)

@charlesdong1991 charlesdong1991 left a comment

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.

very nice one! just some nit comments

internally, without pulling Arrow into your code.
:::
Column types are sent to the server exactly as declared: precision, scale,
length, per-level nullability, and `ROW` field names all round-trip losslessly

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.

does it hold true for Time? i think precision will change still for time?

Comment thread bindings/cpp/src/types.rs
.field_name
.clone();
let field_type = nodes_to_data_type(nodes, cursor)?;
fields.push(DataField::new(field_name, field_type, None));

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.

so we will drop description? i guess it is intended?

EXPECT_THROW((void)fluss::utils::from_ffi_column(col), std::runtime_error);
// Encode a column to the FFI node arena and decode it back, exercising the
// full create-table / get-table-info type transport.
Column RoundTrip(const Column& col) {

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.

Nit: since the targets are precision, comment and char, can we add an integration test that create a table with those type, and then assert get-table-info returns exactly those values?

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.

[cpp] Encode CreateTable column types losslessly

2 participants