-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interest in support for automatic column mapping in RowOriented reader? #90
Comments
Hi @bmacphee, You are correct. The row oriented API makes too many trade-offs between ease of use, flexibility and performance. It's there to make it easy for new starters to read a Parquet file, but not heavily encouraged. Nonethless, the feature you might be looking for is the addition of a C# field attribute to explictly state that a tuple field maps to a particular column name. For example: struct MyTuple
{
[MapToColumnName("Index")]
int Item1;
[MapToColumnName("Value")]
float Item2;
} Orthogonally one can imagine a Perhaps as a first start, if Edit: I cannot decide whether it should be called |
I've also noticed that |
I did consider using attributes as a way to expose this to potential users without having to have a mode toggle argument or something. My initial proof of concept just did it by relying on what's returned from I agree it would make sense to enforce the all-or-nothing approach with the column names, even if the attributes just end up echoing the field names. It's still convenient enough as you only need to write the data class once. I don't have a diff to show right this second but what I did was add this to the ParquetRowReader construction:
and then I appreciate the input. |
Merging into master as part of PR #108. |
Based on this issue (#72), it seems like the row-oriented reader is not really intended to be used as a core part of the library (more of an example).
Is there any interest in a PR to add some minor enhancements to the row oriented API? Specifically, I needed to pass some parquet data to and from a component that doesn't guarantee column order is preserved. When I read it back, I needed to map the columns to my TTuple type by name, rather than by position. I know that can't work for all possible usages of parquet but it was convenient.
The text was updated successfully, but these errors were encountered: