xiangfu0 opened a new pull request, #18783:
URL: https://github.com/apache/pinot/pull/18783
## Problem
The query console (controller web UI) renders a **blank page** whenever a
result set includes a `MAP`-typed column.
Repro: `SELECT * FROM <table>` where the table has a `MAP` column. The
broker serializes a MAP cell as an object, e.g.:
```json
{"value":{"container.image.name":"...", "k8s.pod.name":"...", ...}}
```
In
[`Table.tsx`](https://github.com/apache/pinot/blob/master/pinot-controller/src/main/resources/app/components/Table.tsx),
`makeCell` treats any object with a truthy `value` key as an internal "rich
cell" (`{value, tooltip, component}`, where `value` is a status **string**) and
calls `styleCell(cellData.value)`. For a MAP column, `cellData.value` is itself
an **object**, so `styleCell`'s first statement `str.toLowerCase()` throws:
```
TypeError: str.toLowerCase is not a function
```
This is thrown during React render, and there is no error boundary, so the
entire results view unmounts and the page goes blank.
## Fix
Add a single guarded `toDisplayString` helper that coerces any non-string
cell value to a string before the `String` methods run, shared by both
`styleCell` and `makeCell`. It also guards `JSON.stringify` against throwing
(circular references, `BigInt`) or returning `undefined` (functions, symbols),
so the renderer never throws on an unexpected cell value.
After the fix, a MAP column renders its contents as JSON text instead of
blanking the page; scalar/array columns are unaffected.
## Notes
- Root cause is the column **type** (`MAP`), not any particular column name.
- The controller frontend currently has no JS test harness, so no unit test
is added; the change is a defensive coercion with no behavior change for
existing string/array cells.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]