出现这种问题可能是varchar类型数据导致的。不group by的时候不会遇到。解决方法类似如下写法:
with temp as(
select
cast(primary_channel as string) primary_channel,
cast(channel_keywords as string) channel_keywords,
cast(channel_code as string) channel_code,
cast(channel_name as string) channel_name
from ddi.dim_fill_strategic_channel_level_attribution_df_test
)
select
primary_channel,
channel_keywords,
channel_code,
channel_name
from temp
group by
primary_channel,
channel_keywords,
channel_code,
channel_name