Skip to content

Commit dec6e55

Browse files
committed
update bin.md
Signed-off-by: Kai Huang <ahkcs@amazon.com>
1 parent 996b670 commit dec6e55

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

docs/user/ppl/cmd/bin.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ bin \<field\> [span=\<interval\>] [minspan=\<interval\>] [bins=\<count\>] [align
2020
* day (d, day, days)
2121
* month (mon, month, months)
2222
* minspan: optional. The minimum interval size for automatic span calculation. Cannot be used with span or bins parameters.
23-
* bins: optional. The maximum number of equal-width bins to create. Cannot be used with span or minspan parameters. The bins parameter must be between 2 and 50000 (inclusive).
23+
* bins: optional. The maximum number of equal-width bins to create. Cannot be used with span or minspan parameters. The bins parameter must be between 2 and 50000 (inclusive).
24+
**Limitation**: The bins parameter on timestamp fields has the following requirements:
25+
26+
1. **Pushdown must be enabled**: Controlled by ``plugins.calcite.pushdown.enabled`` (enabled by default). When pushdown is disabled, use the ``span`` parameter instead (e.g., ``bin @timestamp span=5m``).
27+
2. **Timestamp field must be used as an aggregation bucket**: The binned timestamp field must be used in a ``stats`` aggregation (e.g., ``source=events | bin @timestamp bins=3 | stats count() by @timestamp``). Using bins on timestamp fields outside of aggregation buckets is not supported.
2428
* aligntime: optional. Align the bin times for time-based fields. Valid only for time-based discretization. Options:
2529
* earliest: Align bins to the earliest timestamp in the data
2630
* latest: Align bins to the latest timestamp in the data

0 commit comments

Comments
 (0)