-
Notifications
You must be signed in to change notification settings - Fork 914
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
parquet_column_view should use type_dispatcher #5565
Comments
This exact thought crossed my mind when I was working on it, so I tried. But the code for each type is so different that it needed a separate template specialization for each type. There's no code reusability between any two types. The primary goal this achieves is to provide a translation for As a negative, this reduced the readability of the existing code. |
Using the type_dispatcher ensures that any new types added are automatically picked up instead of easy to forget need to manually update the switch statement. |
What good would that be if parquet needs special handling for every type anyway? |
Because the |
The design of Here, for example, we are assigning three separate highly coupled values, and this would require, at the very least, a cudf/cpp/src/io/parquet/writer_impl.cu Lines 118 to 123 in a537380
Although less of an issue, |
That being said, this code works as is and probably shouldn't be changes just for the sake of removing the switch. Replacing it and refactoring the class in to a pure function at the same time would probably be advantageous, but as it stands there's not much to be gained now that it's implemented and tested. The |
One more thought on the subject...
This is actually an argument in favor of |
This issue has been labeled |
Fixed by #7461 |
Describe the bug
parquet_column_view
has an explicit switch over type_ids:cudf/cpp/src/io/parquet/writer_impl.cu
Line 118 in a537380
This kind of code is extremely problematic and is precisely why the
type_dispatcher
was developed.This should be replaced with a type dispatched function object.
The text was updated successfully, but these errors were encountered: