2

Running the command below:

SELECT * FROM MY_STREAM WHERE speed != 0 GROUP BY name LIMIT 10;

results to an error:

Pull queries don't support GROUP BY clauses.

Is there a way to query 10 records with the name value being different and unique across all 10 records returned?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
alphanumeric
  • 17,967
  • 64
  • 244
  • 392

1 Answers1

1

You can try something like this. Also, you can include WINDOW for the specific duration.

  SELECT name, count(*) FROM MY_STREAM
  WHERE speed != 0
  GROUP BY name
  HAVING count(*) = 10
  EMIT CHANGES
  LIMIT 10;

PULL QUERY

  • Pulls the current value from the materialized table and terminate. The result of this statement will not be persisted in a Kafka topic and will only be printed out in the console.
  • The WHERE clause must contain a single value of ROWKEY to retrieve and may optionally include bounds on WINDOWSTART if the materialized table is windowed.
ChristDist
  • 572
  • 2
  • 8