As I mentioned in the comment this is because of aligning its behavior with other query engines like apache spark.
In older versions of Hive:
- The grouping_id was calculated in a high-to-low order, where dimensions appearing in the grouping were assigned 0 and others were assigned 1. The grouping_id would then be converted to a decimal value.
Behavior in Hive 2.3.9:
- The bits are assigned low-to-high order instead.
- This might lead to different decimal results for the same grouping_id setup compared to older versions.
References:
There is a workaround to reach the old result? Let me know if you are intrested in hearing that. I will update the answer.