[cpp] Encode CreateTable column types losslessly#638
Open
fresh-borzoni wants to merge 1 commit into
Open
Conversation
Member
Author
|
@charlesdong1991 @leekeiabstraction PTAL, pls |
cd3399a to
2bea13b
Compare
Member
Author
|
@loserwang1024 @naivedogger Since you expressed an interest in C++ bindings PTAL :) |
charlesdong1991
left a comment
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
does it hold true for Time? i think precision will change still for time?
| .field_name | ||
| .clone(); | ||
| let field_type = nodes_to_data_type(nodes, cursor)?; | ||
| fields.push(DataField::new(field_name, field_type, None)); |
Contributor
There was a problem hiding this comment.
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) { |
Contributor
There was a problem hiding this comment.
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?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #637
Now the column types go to the server natively and are stored exactly as declared.