Reorganize the GroupColumn implementations into more coherent modules
Is your feature request related to a problem or challenge?
While reviewing https://github.com/apache/datafusion/pull/12996 I noticed that all the implementations of GroupColumn for different types were in datafusion/physical-plan/src/aggregates/group_values/group_column.rs which is:
- a single large file
- Not obvious that it is like an implementation detail of
GroupValuesColumn: https://github.com/apache/datafusion/blob/main/datafusion/physical-plan/src/aggregates/group_values/column.rs#L94-L93
Describe the solution you'd like
I would like to propose rearrainging the code:
- Rename https://github.com/apache/datafusion/blob/main/datafusion/physical-plan/src/aggregates/group_values/column.rs to https://github.com/apache/datafusion/blob/main/datafusion/physical-plan/src/aggregates/group_values/multi_column/mod.rs
- Move the implementations in datafusion/physical-plan/src/aggregates/group_values/group_column.rs to different modules within https://github.com/apache/datafusion/blob/main/datafusion/physical-plan/src/aggregates/group_values/multi_column (like
primitive.rs,bytes.rs, etc)
Describe alternatives you've considered
No response
Additional context
No response
Once https://github.com/apache/datafusion/pull/12996 is merged, this would be a good first issue I think as it is just code movement and somewhat mechanical It would be a good way to get introduced to the code
take
https://github.com/apache/datafusion/pull/12996 has now merged so this issue should now be unblocked
@Chen-Yuan-Lai Have you started on this?
Yes, I'm working on this, but have some questions:
-
I trying to rename
/column.rsto/multi_column/mod.rs, and move/group_column.rsto different module. simultaneously, I've also moved some shared trait and function to/multi_column/mod.rs. However,/multi_column/mod.rsitself also defines and implements some data structures (e.g.,GroupValuesColumn,GroupIndexView). It feels too complex as amod.rsfile. Should I split it into other files as well? -
In the original
/group_column.rs, there were some test cases. After splitting/group_column.rsinto three modules (/multi_column/byte.rs,/multi_column/byte_view.rs, and/multi_column/primitive.rs), I move the corresponding tests to their respective files. I'm not sure if this is reasonable, or if it would be better to keep all tests together inmulti_column/test.rs?"
Or you can name it as multi_column.rs and add the submodule in this this file. Structure is similar to datafusion/expr-common/src/type_coercion.rs and you can place trait in multi_column.rs.
I think it is fine to place test in separated file.