spark:expression 'xxx' is neither present in the group by


同一段SQL,在MYSQL中测试通过,挪到大数据执行报错:

org.apache.spark.sql.AnalysisException:
expression 'xxx' is neither present in the group by, nor is it an aggregate function.
Add to group by or wrap in first(or first_value)...

大数据查询遇到这个错误,解决方法已经提示。就是在xxx外面包裹first()函数。

至于原因:

https://www.jianshu.com/p/c131657a5813


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM