Hi Anil

Thanks for your reply albeit bit late. Yea I recognized it and corrected my query.

Today I have sent another seeking an answer on how to sequences in a data frame and upsert the dataframe. Spark integration is working fine and am able to save as table. But I want to use sequences. Any help on this please?

Thanks,
Satya

On 15-Aug-2015 8:44 pm, "anil gupta" <anilgupta84@gmail.com> wrote:
That a basic group by principle in SQL. You will need to add the column in group by.

On Sat, Jun 13, 2015 at 12:47 AM, Ns G <nsgnsg84@gmail.com> wrote:
Hi Team,

I am trying to execute below query. I want all the columns in the table but i get error if i include the columns not under group by. Can someone please help me how to execute this query in phoenix?

select ELS_ID_CODE1, ELS_ID_CODE2, ELS_NAME, ELS_DESC, ELS_ACTIVE, max ( ELS_TIME_ID )  from ndm1.table1  WHERE ELS_ACTIVE = FALSE group by ELS_ID_CODE1, ELS_ID_CODE2, ELS_ACTIVE;


This is the error i am getting

Error: ERROR 1018 (42Y27): Aggregate may not contain columns not in GROUP BY. ELS_NAME (state=42Y27,code=1018)
java.sql.SQLException: ERROR 1018 (42Y27): Aggregate may not contain columns not in GROUP BY. ELS_NAME
        at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:361)
        at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:133)
        at org.apache.phoenix.compile.ExpressionCompiler.throwNonAggExpressionInAggException(ExpressionCompiler.java:1141)
        at org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:378)
        at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:490)
        at org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:447)
        at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:154)
        at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:331)
        at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:314)
        at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:230)
        at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:226)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:225)
        at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1066)
        at sqlline.Commands.execute(Commands.java:822)
        at sqlline.Commands.sql(Commands.java:732)
        at sqlline.SqlLine.dispatch(SqlLine.java:808)
        at sqlline.SqlLine.begin(SqlLine.java:681)
        at sqlline.SqlLine.start(SqlLine.java:398)
        at sqlline.SqlLine.main(SqlLine.java:292)


Thanks,
Durga Prasad



--
Thanks & Regards,
Anil Gupta