From 93a142c7b3cae427c46d4a8ccf04d4c8403cb3f0 Mon Sep 17 00:00:00 2001 From: Khushhal Date: Tue, 3 Feb 2026 18:28:38 +0530 Subject: [PATCH] doc/radosgw/s3select: add SQL LIMIT operator examples This commit adds concrete examples for the SQL LIMIT operator section, demonstrating both non-aggregation queries (retrieving first N rows) and aggregation queries with row processing limits. Signed-off-by: Khushhal doc/radosgw/s3select: fix RST formatting in LIMIT examples - Add empty line before example section for proper paragraph separation - Wrap lines at 80 characters maximum for consistency - Add empty line after final paragraph Signed-off-by: Khushhal --- doc/radosgw/s3select.rst | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/doc/radosgw/s3select.rst b/doc/radosgw/s3select.rst index 8fdcab2631a7..cf829c6386a7 100644 --- a/doc/radosgw/s3select.rst +++ b/doc/radosgw/s3select.rst @@ -428,9 +428,26 @@ trims leading/trailing(or both) characters from target string, the default is bl SQL Limit Operator ~~~~~~~~~~~~~~~~~~ -The SQL LIMIT operator is used to limit the number of rows processed by the query. -Upon reaching the limit set by the user, the RGW stops fetching additional chunks. -TODO : add examples, for aggregation and non-aggregation queries. +The SQL LIMIT operator is used to limit the number of rows processed by the +query. Upon reaching the limit set by the user, the RGW stops fetching +additional chunks. + +**Non-aggregation example** (retrieve first 10 rows): + +.. code-block:: sql + + SELECT _1, _2, _3 FROM s3object LIMIT 10 + +This query returns the first 10 rows from the object without any aggregation. + +**Aggregation example** (count with limit on processing): + +.. code-block:: sql + + SELECT COUNT(*), SUM(CAST(_1 AS INT)) FROM s3object LIMIT 100 + +This query aggregates data but stops processing after 100 rows, returning the +count and sum of column 1 for those rows. Alias ~~~~~ -- 2.47.3