You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 49b5ea9
Browse filesBrowse the repository at this point in the historyBrowse files
DuckDB: support LIMIT 10% and TABLESAMPLE without a method (#2802)
* DuckDB: support LIMIT 10% and TABLESAMPLE without a method
- `LIMIT 10%` and `LIMIT 10 PERCENT` set the new `Limit.percentUnit`.
Inside a LIMIT, a `%` followed by the end of the clause is the unit,
not a modulo; `LIMIT 10 % 3` and `LIMIT a % offset` are unchanged.
- TABLESAMPLE takes DuckDB's optional method and reservoir, as USING
SAMPLE already does: `TABLESAMPLE 10%`, `TABLESAMPLE reservoir(10 ROWS)`.
- A table function keeps and prints its sample clause: `range(10) r
USING SAMPLE 10%` used to lose it.
* Find the percent of LIMIT 10% once and keep columns named offset
- LIMIT scans its clause once for the top-level % followed by its end,
and the Pratt loop stops at that token only, so `LIMIT a % offset + 1`
and modulos nested in sub-selects are unchanged.
- OFFSET ends the clause only before a value, FETCH only before FIRST or
NEXT.
- After DuckDB's TABLESAMPLE n, OFFSET belongs to the query.
- The unit is printed after NULL and ALL too.
0 commit comments