1

I am using Flink SQL generate explain.

select case when count(*)>1 then '11' end as query,case when src_ip='6' then '22' end as query from table

but found exception,it say

Expression 'src_ip' is not being grouped

when I alter count(*) to others,like event_name...

select case when event_name>'test' then '11' end as query,case when src_ip='6' then '22' end as query from table

It is OK,can you help me?

jd g
  • 13
  • 2

1 Answers1

0

The query that doesn't work isn't valid SQL. You can't apply an aggregation (such as count(*)) without having a GROUP BY so that the aggregation has something to aggregate over.

David Anderson
  • 39,434
  • 4
  • 33
  • 60