当>=5个维度且聚合中用了distinct
会报如下错误:An additional MR job is introduced since the cardinality of grouping sets is more than hive.new.job.grouping.set.cardinality.
This functionality is not supported with distincts.
Either set hive.new.job.grouping.set.cardinality to a high number (higher than the number of rows per input row due to grouping sets in the query),
or rewrite the query to not use distincts. The number of rows per input row due to grouping sets is 32 (state=42000,code=10226)
解决方法:如错误日志描述给出的解决方法,可以通过修改 hive.new.job.grouping.set.cardinality 配置,或者在聚合中不用distinct来解决。
假如是5个维度,可以这样设置
set hive.new.job.grouping.set.cardinality=40