【hive报错】SemanticException Failed to breakup Windowing invocations into Groups

背景:在hive取数中,偶然报了这个神奇的错误信息,且系统不能定位到具体地方

报错如下:

SemanticException Failed to breakup Windowing invocations into Groups. At least 1 group must only depend on input columns. Also check for circular dependencies

SemanticException Failed to breakup Windowing invocations into Groups. At least 1 group must only depend on input columns. Also check for circular dependencies

【hive报错】SemanticException Failed to breakup Windowing invocations into Groups_第1张图片

原因:在sql语句中使用了求和开窗函数 sum() over()
且作为分母使用在数值计算中。如:a.num/ sum() over(xxx);
因为分母没有用括号括起来,使得系统产生错误

找到原因后,解决就简单了
在数值计算中,将求和开窗函数括起来
即:a.num/ (sum() over(xxx))
OK,完事~

你可能感兴趣的:(小tips,SQL,hive,hive,大数据)