Skip to content

[fix](docs) fix BITMAP_AGG example setup: k5 overflows BIGINT#3897

Closed
boluor wants to merge 1 commit into
apache:masterfrom
boluor:fix/bitmap-agg-setup-overflow-dev
Closed

[fix](docs) fix BITMAP_AGG example setup: k5 overflows BIGINT#3897
boluor wants to merge 1 commit into
apache:masterfrom
boluor:fix/bitmap-agg-setup-overflow-dev

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented Jun 3, 2026

Problem

The BITMAP_AGG page (dev / docs/ + i18n/zh-CN/.../current/) declares its setup column k5 as BIGINT:

k5 BIGINT
...
INSERT INTO test_bitmap_agg VALUES
    ...
    (4, 40, 140, 41, 500, 40000000000, 18446744073709551616),
    (5, 50, 150, 51, 250, 50000000000, 18446744073709551615),
    ...

But 18446744073709551615 and 18446744073709551616 exceed the BIGINT range, so the INSERT is rejected outright. The table ends up empty and every example on the page fails (table/data missing).

Fix

Change k5 to VARCHAR(32) (and quote its values) so the large values are stored as written. BITMAP_AGG then converts them and applies its own documented range rule — values < 0 or > 18446744073709551615 are dropped — reproducing the example output 0,200000000000000,300000000000000,18446744073709551615. No change to the example SQL or expected outputs.

This matches the column typing already used on the version-3.x / version-2.1 copies of this page.

Verification

Ran the modified page end-to-end on a fresh live master build. Every example reproduces the documented output exactly (EN + ZH, F0).

🤖 Generated with Claude Code

The dev BITMAP_AGG page declares `k5 BIGINT` in its setup table but
inserts 18446744073709551615 and 18446744073709551616, which exceed the
BIGINT range. The whole INSERT is rejected, leaving the table empty, so
every example on the page fails.

Change `k5` to VARCHAR(32) (and quote its values) so the large values are
stored as written; BITMAP_AGG converts them and applies its own range
rule (values < 0 or > 18446744073709551615 are dropped), reproducing the
documented output. Verified end-to-end on a live master build: every
example passes (EN + ZH).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@boluor
Copy link
Copy Markdown
Contributor Author

boluor commented Jun 3, 2026

Folded the dev k5-overflow fix into #3895 so all BITMAP_AGG example-setup changes (dev + 3.x + 2.1) live in a single PR. Closing in favor of #3895.

@boluor boluor closed this Jun 3, 2026
@boluor boluor deleted the fix/bitmap-agg-setup-overflow-dev branch June 3, 2026 05:47
morningman pushed a commit that referenced this pull request Jun 3, 2026
Adds the missing CREATE TABLE + INSERT setup so the BITMAP_AGG and
MAP_AGG examples are runnable end-to-end.

- **bitmap-agg**: dev + version-3.x + version-2.1 (EN + ZH). Includes
the dev k5-overflow fix (k5 `BIGINT` → `VARCHAR(32)`: the INSERT carries
values `18446744073709551615/616` that overflow BIGINT and would reject
the whole row, leaving the table empty; BITMAP_AGG converts the string
per its domain rule, <0 or >uint64max dropped).
- **map-agg**: version-3.x + version-2.1 (EN + ZH), TPC-H `nation` (25
rows).

Verified end-to-end on fresh single-BE clusters (4.1.1 / 3.1.4 / 2.1.11
and local master daily build): every touched example reproduces the
doc's printed output cell-for-cell.

This supersedes #3897 (the dev k5 fix is folded in here so BITMAP_AGG
lives in one PR).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant