Distinct rows¶
distinct: true deduplicates the projected rows. With columns set
you get distinct values over that subset; without columns it acts as
SELECT DISTINCT *.
Combine with predicates / limit / pagination as usual:
{
"columns": ["city", "state"],
"predicates": [{ "col": "severity", "op": "gte", "val": 3 }],
"distinct": true,
"order_by": [{ "col": "state" }, { "col": "city" }],
"limit": 5000,
"page": 1,
"page_size": 100
}
Rules¶
distinctis mutually exclusive withgroup_by/aggregations— combining them returns400. Usegroup_by(with no aggregations) when you also want counts per distinct combination.distinctbypasses the in-memory fast paths and always goes through the SQL engine.- On DuckDB the dedup happens on the raw column values before each row is formatted as JSON, not on the JSON string itself.