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