Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

I'm trying to SET hive.groupby.orderby.position.alias=true in py spark sql, but getting the error.

I'm trying to SET hive.groupby.orderby.position.alias=true in py spark sql, but getting the error.

New Contributor

I'm trying to SET hive.groupby.orderby.position.alias=true in py spark sql, but getting the error.

AnalysisException: u"expression 'Dealer_D' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.;"

Kindly help.

2 REPLIES 2

Re: I'm trying to SET hive.groupby.orderby.position.alias=true in py spark sql, but getting the error.

Expert Contributor

Which Spark version do you use, and could you post a short example of your SQL here?

Re: I'm trying to SET hive.groupby.orderby.position.alias=true in py spark sql, but getting the error.

Expert Contributor

I'm wondering the use case because both `spark.sql.groupByOrdinal` and `spark.sql.orderByOrdinal` are true by default in Spark.

Don't have an account?
Coming from Hortonworks? Activate your account here