Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions databases/kafka.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ where retention has removed messages from the middle of a compacted topic.

Schema Registry is not read. A binary `value` column of Protobuf messages decodes field by field
with **Display As > Protobuf**, which reads the five-byte Confluent wire-format prefix and shows the
schema ID; see [Binary value viewer](/features/json-viewer#binary-value-viewer). Avro values show
as raw bytes.
schema ID; see [Binary value viewer](/features/json-viewer#binary-value-viewer). Avro values decode
with **Display As > Avro Schema…** and the topic's `.avsc` file, past the same prefix.

Creating a topic, editing topic configuration, and resetting consumer group offsets are not
available. Deleting a topic is, as the paragraph above describes.
Expand Down
23 changes: 13 additions & 10 deletions features/json-viewer.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Cell and Row Viewers
description: View and edit JSON, PHP serialized, image and binary cell values, decode MessagePack and Protobuf, set per-column display formats, and inspect whole rows in the sidebar
description: View and edit JSON, PHP serialized, image and binary cell values, decode MessagePack, Protobuf, igbinary and Avro, set per-column display formats, and inspect whole rows in the sidebar
---

Click the chevron on a JSON or blob cell to open its value in a popover anchored to that cell. Which viewer opens follows the column: its declared type, or the **Display As** choice on its header, and that choice changes rendering only, never what is stored.
Expand All @@ -21,7 +21,8 @@ Right-click a column header and pick **Display As**. The submenu lists the forma
| Unix Timestamp (milliseconds) | integer | Same, treating the number as milliseconds |
| JSON | text | Opens the cell in the JSON viewer |
| PHP Serialized | text | Opens the cell in the PHP serialized viewer |
| MessagePack, Protobuf | binary | Decodes the bytes and opens the cell in the [binary value viewer](#binary-value-viewer) |
| MessagePack, Protobuf, igbinary | binary | Decodes the bytes and opens the cell in the [binary value viewer](#binary-value-viewer) |
| Avro Schema… | binary | Asks for the `.avsc` file the values were written with, then decodes like the formats above |

An override persists per column, scoped to the connection and table. A column with a format set copies in that format when you copy the single cell; a block of cells or a whole row always copies the stored value.

Expand Down Expand Up @@ -101,16 +102,18 @@ An array or object row copies as its summary, such as `[2 items]`, not as its co

## Binary value viewer

Set **Display As > MessagePack** or **Protobuf** on a binary column. The grid shows each value decoded on one line, and double-click or `Enter` opens the viewer. It is read-only. On an editable table the chevron still opens the hex editor, and so does double-clicking a NULL cell.
Set **Display As > MessagePack**, **Protobuf** or **igbinary** on a binary column, or pick **Avro Schema…** and choose the column's schema file. The grid shows each value decoded on one line, and double-click or `Enter` opens the viewer. It is read-only. On an editable table the chevron still opens the hex editor, and so does double-clicking a NULL cell.

| Mode | MessagePack | Protobuf |
| --- | --- | --- |
| **Tree** | The [JSON tree](#selecting-and-copying-in-a-tree), with `bin`, `ext` and `time` badges for the types JSON lacks | Field numbers, badged with the wire type: `varint`, `i32`, `i64`, `len` or `group` |
| **Text** | JSON. Bytes as `0x` hex, an extension as `ext(5) 0x…`, a timestamp in UTC | Text format, as `protoc --decode_raw` prints it |
| **Hex** | The stored bytes | The stored bytes |
| Mode | MessagePack, Avro | Protobuf | igbinary |
| --- | --- | --- | --- |
| **Tree** | The [JSON tree](#selecting-and-copying-in-a-tree), with `bin`, `ext` and `time` badges for the types JSON lacks | Field numbers, badged with the wire type: `varint`, `i32`, `i64`, `len` or `group` | The [PHP serialized tree](#php-serialized-viewer) |
| **Text** | JSON. Bytes as `0x` hex, an extension as `ext(5) 0x…`, a timestamp in UTC | Text format, as `protoc --decode_raw` prints it | The value as PHP's `serialize()` writes it |
| **Hex** | The stored bytes | The stored bytes | The stored bytes |

Protobuf without its schema has no field names or types. A length-delimited field reads as a nested message when its bytes parse as one, else as text when they are UTF-8, else as escaped bytes, so a short string can read as a message. A value that starts with a Schema Registry frame, as Kafka producers write it, shows its schema ID and message index above the tree.

Avro reads each value as one datum written with the chosen schema. A record shows its fields in schema order, a union shows the branch it holds, and logical types read as what they stand for: `decimal` as a number, `uuid`, `date`, `time` and `duration` as text, `timestamp` in UTC, `local-timestamp` without a zone. The menu names the column's format after the schema's root type, as in **Avro (Order)**. TablePro keeps a copy of the schema, so moving or deleting the file later changes nothing; pick **Avro Schema…** again to replace it. A value with the Kafka wire-format prefix decodes past it, and the viewer shows its schema ID. A value in Avro's single-object encoding, as Java's `toByteBuffer()` writes it, decodes when its schema fingerprint matches the chosen schema, and the viewer shows the fingerprint.

A value that does not decode stays hex in the grid, and the viewer says where it broke above its hex dump. Copying a single cell copies the decoded text, cut at 40,000 characters. **Find** searches the decoded text.

## Blob and hex
Expand Down Expand Up @@ -144,7 +147,7 @@ A value that refuses to open in one mode still opens in another.
| JSON tree | 100,000 characters, indentation not counted | "JSON Too Large". Read it in Text mode |
| JSON and PHP trees | 5,000 nodes | The first 5,000 load, and a `…` row marks the cut |
| PHP serialized | 5,000,000 characters, 256 levels deep | Tree shows a placeholder, Raw still works |
| MessagePack, Protobuf | 5,000,000 bytes; 256 levels deep, 100 for Protobuf | The cell stays hex, and the viewer says why |
| MessagePack, Protobuf, igbinary, Avro | 5,000,000 bytes; 256 levels deep, 100 for Protobuf | The cell stays hex, and the viewer says why |
| Decoded binary in the grid | 40,000 characters | The text ends in `…` |
| Decoded binary in **Text** mode | 500,000 characters | The text ends in `…` |
| Hex dump and hex editor | 10 KB | The dump is truncated, and the editor opens read-only |
Expand All @@ -162,7 +165,7 @@ A value that refuses to open in one mode still opens in another.
| A spatial column whose value the map reads, or GeoJSON in a JSON column | [Map](#geometry-fields), stored value behind **Text** |
| A JSON column, or text that parses as JSON | JSON editor |
| A PHP serialized value | Read-only [PHP viewer](#php-serialized-viewer) |
| A binary column set to MessagePack or Protobuf | Read-only [binary value viewer](#binary-value-viewer) |
| A binary column set to MessagePack, Protobuf, igbinary or Avro | Read-only [binary value viewer](#binary-value-viewer) |
| An image, in any column | [Image viewer](#image-viewer), source behind the second segment |
| An enum, set, or boolean column | Picker |
| A blob column, or other bytes in a spatial column | Hex editor |
Expand Down
Loading