Description
HiveRelColumnsAlignment was introduced to align the order of columns in join, group-by, and order-by operators in the plan pipeline, trying to increase the effect of ReduceDeduplication and thus reducing data shuffle.
The optimization could be extended to reorder group-by and join keys on decreasing NDV, which would accelerate comparison runtime.