PROFILE TABLE — discover a table's shape

View .md

Schema discovery over schemaless data — the statement you run first against a table you didn't design. One result row per attribute: coverage against the sample, type distribution ("Number 94% · String 6%"), NULL vs MISSING vs empty counts, and a "mixed types" note when an attribute carries more than one shape.

Syntax

sql
PROFILE TABLE "table"[WHERE predicates]   -- bounds what's sampled[LIMIT n]            -- bounds the rows read

A profile that hits the read cap returns a disclosed partial sample ("sampled the first N items — the table continues") rather than refusing — unlike an aggregate, a sample is an honest answer. Guide: Aggregates & profiling.

Use cases

Meet an unfamiliar table Lowered

Inherited a production table with no docs? Profile it before you query it — the attribute list, their types, and how consistently they're present.

sql
PROFILE TABLE "stage.Orders"
Executes asSampled read (capped at 100 pages) → one result row per attribute
  • Every sampled item is read and billed like any read — the cap keeps the bill bounded on big tables.
Profile one tenant's slice Lowered

In a shared table, different tenants can carry different shapes — WHERE bounds what's sampled and LIMIT bounds the rows read.

sql
PROFILE TABLE "stage.Orders"WHERE tenantId = 'kanject' LIMIT 5000
Executes asSampled read of the matching slice · LIMIT 5000

Try it

Try it · PROFILE TABLESample
Executes asSampled read · stage.Orders → profile
Scan (sampling, capped) · LIMIT 5000 → fold: per-attribute coverage & types
The sample is disclosed: 5,000 of ~48,000 items — a partial profile is an honest answer.
#attributecoveragetypes
1orderId100%String
2total98%Number 94% · String 6% — mixed
3couponCode11%String
Fetched 5000 items in 420ms · 625 RCU · 24 partitions

Related: Aggregates & profiling · SELECT · Tables, indexes & replicas for CREATE GSI.

Was this page helpful?