Skip to content

[C++] Support iterable types in RowEncodeTrait#1212

Merged
chaokunyang merged 1 commit intoapache:mainfrom
PragmaTwice:encoder-array
Dec 6, 2023
Merged

[C++] Support iterable types in RowEncodeTrait#1212
chaokunyang merged 1 commit intoapache:mainfrom
PragmaTwice:encoder-array

Conversation

@PragmaTwice
Copy link
Member

@PragmaTwice PragmaTwice commented Dec 6, 2023

What do these changes do?

In this PR we support any iterable types for RowEncodeTrait and its combination with struct types, e.g.

std::vector<int>

// nested array type
std::vector<std::vector<int>>

// class type in array type
struct A { ... }
std::vector<A>

// array in class type
struct B {
  std::vector<...> field1;
  ...
}

Check code requirements

  • tests added / passed (if needed)
  • Ensure all linting tests pass, see here for how to run them

Copy link
Collaborator

@chaokunyang chaokunyang left a comment

Choose a reason for hiding this comment

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

LGTM. one more thing, do we need to add an ArrayEncoder in array_encoder.h ?

@chaokunyang chaokunyang merged commit 71121ca into apache:main Dec 6, 2023
@chaokunyang
Copy link
Collaborator

chaokunyang commented Dec 6, 2023

Those meta programing codegen is really impressive, learned a lot from your code 😄

@PragmaTwice
Copy link
Member Author

PragmaTwice commented Dec 7, 2023

do we need to add an ArrayEncoder in array_encoder.h ?

I plan to extend RowEncoder<T> rather than adding a new class, so users don't need to use different class to encode different types.

@chaokunyang
Copy link
Collaborator

do we need to add an ArrayEncoder in array_encoder.h ?

I plan to extend RowEncoder<T> rather than adding a new class, so users don't need to use different class to encode different types.

OK, got it

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.

2 participants