Overview
Factor House's Data inspect function allows you to quickly search and filter the rows of an Apache Iceberg table.
- Select a namespace and a table from any configured catalog.
- The interface will stream the matching rows back as they are found.
- You can combine this with kJQ filters to apply conditions to each row, and with projections to choose the columns returned.
You can read the table as of its current snapshot, or look back at an earlier snapshot, timestamp or duration ago.
Every search is a streaming search. Rows are sent to the browser as they are found, and a query stops when it has found the requested number of matching rows (the result limit), reaches the end of the table, or runs out of time. You can cancel a search at any time and keep the rows already received.
Usage
Opening Data inspect
There are two ways to open Data inspect for an Iceberg catalog:
- Choose Data in the Focus group of the catalog's sidebar menu.
- Open a table and click Inspect data. This opens Data inspect with the namespace and table already selected. It does not run the search for you.
Table
- Namespace: the namespace to search. Required.
- Table: a table within the namespace. Required. Available once a namespace is selected.
Read as of
The Read as of field decides which version of the table is read. By default Data inspect reads the Current snapshot.
- Current snapshot: read the table as it is now
- Snapshot: read the table at a specific snapshot. The selector lists the table's snapshots as
<snapshot id> · <UTC timestamp> - Timestamp: read the table as of a point in time, given as epoch milliseconds (for example
1591775989279) - Datetime: read the table as of a point in time, chosen from a date and time picker
- Duration ago: read the table as it was a duration ago, given in ISO 8601 duration format
For Timestamp, Datetime and Duration ago, Data inspect reads the latest snapshot committed at or before that point in time. A time before the table's first snapshot returns an error.
Durations accept hours, minutes and seconds, as well as days. Month and year durations are not supported. For example:
PT30Mis thirty minutesPT1His one hourP1Dis one dayP2DT3H15Mis two days, three hours and fifteen minutes
Data inspect reads snapshots by id, timestamp or duration. Selecting a branch or tag is not supported, and you cannot restrict a search to specific partitions. Use a filter to narrow the rows read.
Filtering
Use a kJQ filter to return only the rows that match a condition, for example .status == "overdue" and .amount > 1000.
Filters are evaluated against the columns of each row. See kJQ filters for the supported syntax.
Projections
A projection expression chooses which columns Data inspect returns. Leave it blank to return every column.
A projection is a comma-separated list of selectors:
| Selector | Returns |
|---|---|
.customer | The customer column |
."unit price" | A column whose name contains spaces or special characters |
.address.city | A field within a struct column |
.items[0] | The first element of a list column |
.items[1:3] | A slice of a list column |
For example, .id, .customer, .items[0] returns three columns.
- A projection can select at most 10 columns.
- The first part of every selector must be an existing top-level column. Otherwise the search fails with an
Unknown columnserror. - Selecting the same path both whole and in part (for example
.itemsand.items[0]) is rejected as a conflict. - Selectors for paths that don't exist in a row (such as a struct field that is missing) are left out of that row.
- Comments starting with
#are allowed.
You can filter on columns that you do not project.
When there is no filter, Data inspect reads only the projected top-level columns from the table, which makes projecting a few columns of a wide table cheaper than returning all of them.
Result limit
The Result limit is the number of matching rows after which the search stops. The default is 100 and the maximum is 300. A larger value is reduced to 300.
When the limit is reached, Data inspect reports that more rows match the query. Run a narrower query (for example with a tighter filter or an earlier snapshot) to see other rows.
Running a search
Click Search or press Shift + Enter in the filter field. Search is disabled until you have selected a namespace and a table.
The query editors support autocomplete: press Ctrl + Space to open it, ↑ and ↓ to move, Enter to accept and Esc to close.
Other form controls:
- Clear form: reset the form to its defaults and close all result tabs.
- Options > Sync form with results: when enabled, selecting a result tab fills in the form with the query that produced it. Disabled by default.
Query results
Result tabs
Each search opens a new result tab. Tabs are kept for each catalog, namespace and table, so you can compare the results of different queries. Closing a tab that is still running cancels its query.
A tab's label shows its state:
- Queued...: the search is waiting for a free worker
- Loading table...: Factor House is loading the table from the catalog
- Consuming... N: rows are being read, and N rows have been read so far
- namespace.table: the search has finished
- Query error: the search failed. The error is shown in a Request failed message
Results toolbar
The results toolbar shows:
- A progress bar for the query. It turns red if the query fails.
- The number of matched / read rows. Hover over it to see how many rows were realized, read and skipped, and how long the query took.
- Cancel consuming, shown while a query is running. The rows received so far stay on screen and the result is marked as incomplete.
- Copy query URL, which copies a link to Data inspect with the query filled in.
- Event log, which lists events such as how long the table took to load, and whether the query timed out, was cancelled or reached its limit.
- Context, which shows the query details and an evaluation summary.
- Display, which controls how rows are shown.
- Download, which exports the results.
Context
Click Context to expand the query and its evaluation.
The Query section repeats the namespace, table, Read as of value, filter, projection and limit.
The Evaluation section reports:
- Rows read: the number of rows read from the table
- Rows matched: the number of rows that matched the filter and are returned
- Rows skipped: the number of rows that did not match the filter
- Elapsed: how long the query ran
- Table load time: how long it took to load the table from the catalog
- Snapshot: the id of the snapshot that was read
- Result: how the query ended
The Result is one of:
- Complete, all rows were read
- Limit reached, more rows match
- Timed out, the result is incomplete
- Cancelled, the result is incomplete
- In progress
Rows
Each result shows:
- position: the position of the row within the results, starting at 0
- snapshot: the id of the snapshot that the row was read from
- row: the row, as JSON
Data inspect returns the first rows it finds that match the query, in the order the table is scanned. This is not a random sample and not sorted by any column.
If the query completes without returning rows, Data inspect shows No rows found.
Column values
Values are shown as JSON:
| Iceberg type | Shown as |
|---|---|
boolean, int, long, float, double | A JSON boolean or number |
string | A JSON string |
decimal, uuid | A string, for example "12.50" |
date, time, timestamp, timestamptz | A string in ISO-8601 style |
fixed | A base64 string |
binary | A string when the bytes are valid UTF-8, otherwise a base64 string |
struct | A JSON object with a key for each field |
list | A JSON array |
map | A JSON object |
Any null value | null |
Because a binary value that happens to be valid UTF-8 is shown as text, a base64 string and a plain string cannot always be told apart in the output.
Display options
Click Display to change how rows are shown. The options are:
- Row format: Pretty printed (default) or Raw
- Visible fields: show or hide Position, Snapshot and Row
Click Reset to default to restore the defaults.
Downloading results
Use Download to export the results in one of these formats:
- as CSV
- as EDN
- as JSON
The download is created in your browser from the rows already received for the selected result tab, so it contains at most 300 rows and does not contain rows that have not been read. Struct, list and map values are written as JSON strings in CSV cells.
To export more rows, narrow the query so that fewer than 300 rows match.
Configuration
Worker configuration
Data inspect queries run on a queue of workers for each Iceberg catalog. When a request comes in, Factor House assigns it to a free worker, or holds it in the queue as Queued... until a worker is free. If the queue is full, the search is rejected with Sampler unavailable: Queue is at capacity. Please retry later. and you will need to retry.
| Variable | Description | Default |
|---|---|---|
SAMPLER_N_WORKERS | The number of queries that can run at the same time | 3 |
SAMPLER_WORKER_BUFFER_SIZE | The number of queries that can wait in the queue before requests are rejected | 1000 |
SAMPLER_TIMEOUT_MS | The time, in milliseconds, after which a query stops and returns the rows found so far | 30000 |
When a query times out, the rows found so far are returned and the Result is Timed out, the result is incomplete. Run the query again with a more selective filter, a projection of fewer columns, or a smaller table snapshot to find more rows.
Kpow reads the same SAMPLER_* environment variables, including SAMPLER_N_WORKERS and SAMPLER_TIMEOUT_MS. In a Factor House deployment a single value applies to both Kpow and Iceberg data inspect.
Access to table data
Data inspect reads data files from your object storage using the same catalog configuration that Factor House uses to observe the table. The IAM role or user that Factor House runs as must be allowed to read your table's data files in Amazon S3, not only its metadata, and to decrypt them if they are encrypted with AWS KMS. See AWS S3 and KMS to set up the IAM role, and Iceberg configuration for the S3 properties.
Factor House 97.1 supports Iceberg catalogs and object storage on AWS only. Support for Google Cloud and Azure is planned for later releases.
Tenancy
Data inspect honours Factor House's multi-tenancy. A search fails if the namespace and table it targets are outside the tenant you are working in.
Limitations
- A query returns at most 300 rows.
- Filters are applied to each row after it is read. They are not pushed down to Iceberg, so a very selective filter on a large table can reach the query timeout before enough matching rows are found.
- Filters can only use the table's columns. Row metadata such as the file path or partition is not available.
- Branches, tags and partition selection are not available.
- A projection can select at most 10 columns.
- Downloads contain only the rows that have been read, up to 300.