Skip to content

Web UI: recognize BFloat16 as a floating point number - #110433

Merged
alexey-milovidov merged 7 commits into
masterfrom
play-bfloat16-number
Jul 17, 2026
Merged

alexey-milovidov merged 7 commits into
masterfrom
play-bfloat16-number

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jul 14, 2026 •

Copy link
Copy Markdown
Member

In the Web UI (play.html), the BFloat16 type was not recognized as a number. As a result, BFloat16 columns were not right-aligned and were not colorized like other numeric columns. This extends the numeric type detection regex to also match BFloat16.

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

In the Web UI (Play), BFloat16 is now recognized as a floating point number and its columns are right-aligned and colorized accordingly.

Version info

  • Merged into: 26.7.1.1103 (included in 26.7 and later)

In the Web UI (`play.html`), the `BFloat16` type was not recognized as a
number, so its columns were not right-aligned nor colorized like other
numeric columns. Extend the numeric type detection to also match
`BFloat16`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [b4e5074]

Summary: ✅


AI Review

Summary

This PR extends Play's result-type normalization so BFloat16 columns, including those wrapped in Nullable, LowCardinality, or SimpleAggregateFunction, are classified as numeric/date for alignment and colorization. I re-checked the current diff against the live code, prior inline threads, and the current PR discussion, and I do not see a remaining correctness issue in the changed path.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Jul 14, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

The failure of Stateless tests (amd_tsan, s3 storage, sequential, 2/2) is unrelated to this PR: it is a pre-existing data race between CachedOnDiskReadBufferFromFile::readFromFileSegment and CachedOnDiskReadBufferFromFile::getInfoForLog (the Server died failure is a consequence of the same race, since TSan runs with halt_on_error=1). The same race also occurred on master and on several unrelated PRs. The fix is in progress in #110154.

Merged master to re-run CI.

Comment thread programs/server/play.html Resolved
@alexey-milovidov

Copy link
Copy Markdown
Member Author

The Stateless tests (amd_tsan, s3 storage, sequential, 2/2) failure here is unrelated to this Web UI change — it is a pre-existing ThreadSanitizer data race in the FileCache read path (CachedOnDiskReadBufferFromFile::getInfoForLog reading a shared remote reader), reproduced on several unrelated PRs. Tracked in #110564, fix in #110565.

`JSONCompact` keeps wrapper type names in the result metadata, so a
column such as `LowCardinality(BFloat16)` reached the numeric-type
check as the literal string `LowCardinality(BFloat16)` and failed the
prefix match, leaving it left-aligned and uncolorized. Strip an outer
`Nullable` or `LowCardinality` wrapper before testing the base type.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

The CI run before this branch was updated to latest master had three reds, all unrelated to this one-line play.html change:

@groeneai, please check whether #109114 already covers the arm_release stress failure above; if not, could you investigate and provide a fix in a separate PR?

@groeneai

Copy link
Copy Markdown
Collaborator

@alexey-milovidov Yes, #109114 covers this arm_release failure; no separate PR needed.

The stress abort (STID 2228-453d, Block structure mismatch in JoinStep: [__table3.number, __table3.number] and [__table3.number], checkBlockStructure -> JoinStep::updatePipeline) came from 04327_correlated_subquery_duplicate_column_join.sql. Its query is byte-identical to #109114's repro:

WITH t AS (SELECT number, * FROM numbers(3))
SELECT *, (SELECT t.number WHERE t.number >= 0) AS r FROM t;

Same root cause #109114 fixes: SELECT number, * gives the build header two columns named number; with enable_join_runtime_filters=1 the runtime filter is built on that duplicated key by name, changing a downstream join input's stream multiplicity and aborting. #109114 guards tryAddJoinRuntimeFilter to skip the filter when a build-side join KEY name occurs more than once (correctness-safe).

Verified locally on the #109114 branch, both directions:

  • Guard reverted (pre-fix binary): the query SIGABRTs with the JoinStep mismatch.
  • With the guard (fix binary): correct results; 04493 (its regression test) and the failing 04327 both pass.

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110433&sha=91eb1f664015bacc72d5e93bea01298fc23d5929&name_0=PR&name_1=Stress%20test%20%28arm_release%29

The other two reds are as you noted: 01900_kill_mutation_parallel_long is a host-pressure flake, and the hung check is #107941.

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial. LGTM.

@pamarcos pamarcos self-assigned this Jul 16, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

All four reds of the latest finished run (commit 62da4c8) are unrelated to this one-line play.html change:

Merged master to re-run CI.

Comment thread programs/server/play.html Resolved
Address AI review (#110433):
the previous normalization only stripped a single outer `Nullable` or
`LowCardinality` wrapper, so a column whose result-set metadata carries a
scalar value type behind another wrapper - e.g.
`SimpleAggregateFunction(sum, BFloat16)` or
`SimpleAggregateFunction(sum, Nullable(BFloat16))` - was still classified as
non-numeric and stayed left-aligned and uncolorized.

Peel transparent scalar wrappers (`Nullable`, `LowCardinality`,
`SimpleAggregateFunction`) recursively down to the underlying value type
before running the numeric/date regexes. `AggregateFunction` is intentionally
left alone: its values are opaque serialized states, not scalars, so they
should stay left-aligned and uncolorized.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 17, 2026
Merged via the queue into master with commit af3ed20 Jul 17, 2026
179 checks passed
@alexey-milovidov
alexey-milovidov deleted the play-bfloat16-number branch July 17, 2026 15:09
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 17, 2026
pull Bot pushed a commit to sonvt1710/ClickHouse that referenced this pull request Jul 18, 2026
The test asserts `QueryConditionCacheHits` on the instance-wide query
condition cache. A parallel sibling test that drops or renames any
UUID-less (path-keyed) `MergeTree` table calls `Context::clearCaches`,
which wipes the query condition cache, so an expected cache hit turns
into a miss and the test output differs from the reference.

Confirmed from a failed CI run: `CurrentMetric_QueryConditionCacheEntries`
dropped from 331 to 1 exactly between the test's cache-populating query
and the query expected to hit the cache, with no
`SYSTEM DROP QUERY CONDITION CACHE` in the server log.

All other tests asserting query condition cache hits are already tagged
no-parallel for the same reason.

Failures:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110433&sha=62da4c8be297d0ee37833fc6d0af32868f4bbc9f&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20distributed%20plan%2C%20parallel%29
ClickHouse#110433
ClickHouse#110630

Co-Authored-By: Claude Fable 5 <[email protected]>
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
Address AI review (ClickHouse#110433):
the previous normalization only stripped a single outer `Nullable` or
`LowCardinality` wrapper, so a column whose result-set metadata carries a
scalar value type behind another wrapper - e.g.
`SimpleAggregateFunction(sum, BFloat16)` or
`SimpleAggregateFunction(sum, Nullable(BFloat16))` - was still classified as
non-numeric and stayed left-aligned and uncolorized.

Peel transparent scalar wrappers (`Nullable`, `LowCardinality`,
`SimpleAggregateFunction`) recursively down to the underlying value type
before running the numeric/date regexes. `AggregateFunction` is intentionally
left alone: its values are opaque serialized states, not scalars, so they
should stay left-aligned and uncolorized.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…mber

Web UI: recognize BFloat16 as a floating point number
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
The test asserts `QueryConditionCacheHits` on the instance-wide query
condition cache. A parallel sibling test that drops or renames any
UUID-less (path-keyed) `MergeTree` table calls `Context::clearCaches`,
which wipes the query condition cache, so an expected cache hit turns
into a miss and the test output differs from the reference.

Confirmed from a failed CI run: `CurrentMetric_QueryConditionCacheEntries`
dropped from 331 to 1 exactly between the test's cache-populating query
and the query expected to hit the cache, with no
`SYSTEM DROP QUERY CONDITION CACHE` in the server log.

All other tests asserting query condition cache hits are already tagged
no-parallel for the same reason.

Failures:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110433&sha=62da4c8be297d0ee37833fc6d0af32868f4bbc9f&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20distributed%20plan%2C%20parallel%29
ClickHouse#110433
ClickHouse#110630

Co-Authored-By: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants