yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.86k stars 1.05k forks source link

[YCQL] Check support for OFFSET with aggregates (like MIN) #15086

Open pkj415 opened 1 year ago

pkj415 commented 1 year ago

Jira Link: DB-4302

Description

We allow OFFSET in SELECT queries in YCQL, but apache cassandra doesn't (https://cassandra.apache.org/doc/latest/cassandra/cql/dml.html)

Given this, did we intend to support aggregates queries like MIN with OFFSET?

If we did, check if it works correctly and add tests. If not, ensure that it errors out explicitly.

OlegLoginov commented 1 year ago

OFFSET can be useful for an aggregate function like AVG or MIN if you want to get a result for a random subset of rows. E.g. for 1 or for a few tablets. That's why I've not disabled OFFSET for aggregate functions. (In the fix for https://github.com/yugabyte/yugabyte-db/issues/13295.)