> ## Documentation Index
> Fetch the complete documentation index at: https://developers.askparable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# tableShapeStats

> Latest TableShapeStats snapshot for every contract in the workspace's
catalog. First-build implementation of the typed stats surface
EDR-0031 proposed. The canonical type lives in
platform-schemas/services/dataplane-maintenance/; records are written by
services/provider-transformations queue jobs through
parable-dataplane-quality-rs.



## OpenAPI

````yaml /api-reference/openapi.json get /api/catalog/table-shape-stats
openapi: 3.0.3
info:
  title: Parable API
  description: >-
    The REST API for your Parable workspace: manage connectors and taps, explore
    your data catalog, upload artifacts, and administer users and roles.
  version: v1
servers:
  - url: https://api.askparable.com
    description: Production
security: []
paths:
  /api/catalog/table-shape-stats:
    get:
      tags:
        - catalog
      summary: tableShapeStats
      description: |-
        Latest TableShapeStats snapshot for every contract in the workspace's
        catalog. First-build implementation of the typed stats surface
        EDR-0031 proposed. The canonical type lives in
        platform-schemas/services/dataplane-maintenance/; records are written by
        services/provider-transformations queue jobs through
        parable-dataplane-quality-rs.
      operationId: CatalogTableShapeStatsHandler
      parameters:
        - description: >-
            Workspace slug. Overrides subdomain-based workspace resolution when
            provided.
          in: header
          name: X-Tenant
          required: false
          schema:
            example: acme
            type: string
        - description: Optional request correlation ID echoed back in the response.
          in: header
          name: X-Request-ID
          required: false
          schema:
            example: 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/TenantTableShapeStatsResponse'
                  links:
                    $ref: '#/components/schemas/ResponseLinks'
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
                required:
                  - data
                  - meta
                type: object
          description: Successful response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad request
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal server error
      security:
        - bearerAuth: []
components:
  schemas:
    TenantTableShapeStatsResponse:
      description: |-
        Web-api maintenance proxy types.
        TableShapeStats / ColumnShapeStats / TableSpcResult / SpcSeriesResult /
        SpcRuleViolation / TableQualityResult / QualityCheckResult /
        QualityCheckSpec / QualityCheckEvidence / TableMaintenanceResult are
        defined canonically in platform-schemas/services/dataplane-maintenance/.
        services/provider-transformations queue jobs write them through
        parable-dataplane-quality-rs, and this schema imports them through the
        `dataplane-maintenance` schema dependency.
        Only the workspace-scoped bulk response wrappers live here; they carry
        the web-api-specific *Version fields and bundle the canonical result
        types for the proxy surface.
      properties:
        stats:
          items:
            $ref: '#/components/schemas/TableShapeStats'
          type: array
        statsVersion:
          type: string
        tenantId:
          description: UUID v4 with automatic base62 encoding for client-facing APIs
          type: string
      required:
        - tenantId
        - statsVersion
        - stats
      type: object
    ResponseLinks:
      properties:
        first:
          nullable: true
          type: string
        last:
          nullable: true
          type: string
        next:
          nullable: true
          type: string
        prev:
          nullable: true
          type: string
      type: object
    ResponseMeta:
      properties:
        requestId:
          description: Unique identifier for the request
          type: string
        totalCount:
          description: Total count of items for paginated responses
          nullable: true
          type: integer
      required:
        - requestId
      type: object
    Error:
      properties:
        error:
          type: string
      type: object
    TableShapeStats:
      description: >-
        Canonical shape statistics records. services/provider-transformations
        queue

        jobs write them through parable-dataplane-quality-rs, and

        services/query-layer reads them.

        These replace the legacy services/transformation-flows shape_capture.py

        Delta writer; the dataset_id-keyed shape_history table is read-only

        after cutover (P7).

        Latest shape snapshot for a contract, produced by a

        services/provider-transformations queue job. Replaces the legacy

        shape_history row from services/transformation-flows.
      properties:
        capturedAt:
          description: Wall-clock timestamp the snapshot was captured.
          type: string
        columnCount:
          description: >-
            Signed 64-bit integer; range bounded by JavaScript's safe-integer
            ceiling.
          format: int64
          type: integer
        columns:
          description: Per-column entries. Order matches the contract outputSchema.
          items:
            $ref: '#/components/schemas/ColumnShapeStats'
          type: array
        dataContractId:
          description: UUID v4 with automatic base62 encoding for client-facing APIs
          type: string
        distinctCountsExact:
          description: >-
            When false, distinct counts in ColumnShapeStats are approximate

            (e.g. HLL). v1 always sets this to true: DataFusion's
            COUNT(DISTINCT)

            is exact.
          type: boolean
        layer:
          $ref: '#/components/schemas/DataContractLayerEnum'
          description: Layer of the contract at the time of capture.
        loadType:
          description: |-
            Optional label set on backfill rows so historical shape_history
            conversions can be filtered out by SPC consumers. Empty on rows
            written by services/provider-transformations queue jobs.
          type: string
        rowCount:
          description: Dataset-level metrics.
          format: int64
          type: integer
        runDate:
          description: >-
            Calendar date, normalized to ISO 'YYYY-MM-DD'. Accepts ISO
            ('2025-01-01'), slash-separated ('2025/01/15', '01/15/2025'),
            named-month ('January 15, 2025', 'Jan 15, 2025'), and full RFC3339
            datetime (the time portion is dropped).
          type: string
        runId:
          description: >-
            Run identity. runId is the maintenance run UUID (NOT the

            transformation-flow write UUID, which is the shape_history
            convention);

            runDate is the logical date the run targets in YYYY-MM-DD form.
          type: string
        snapshotId:
          description: |-
            Stable identity for this snapshot. Equal to the maintenance run UUID
            for the row that produced it; two reads of the same row return the
            same snapshotId.
          type: string
        storageUri:
          description: |-
            Source Delta path of the contract this snapshot was computed against
            (the contract's outputUri, NOT the maintenance stats path).
          type: string
        tapContractId:
          description: |-
            The contract this snapshot describes. Exactly one of tapContractId /
            dataContractId is non-null.
          type: string
        totalByteSize:
          description: >-
            Total uncompressed byte size of the underlying Delta table at
            capture

            time, summed from Delta add-action metadata. Null when the size

            cannot be determined.
          format: int64
          type: integer
      required:
        - snapshotId
        - layer
        - runId
        - runDate
        - capturedAt
        - rowCount
        - columnCount
        - distinctCountsExact
        - storageUri
        - columns
      type: object
    ColumnShapeStats:
      description: |-
        Per-column snapshot. Embedded in TableShapeStats; not stored
        independently.
      properties:
        arrowType:
          description: |-
            Arrow physical type for the column (e.g. "Int64", "Utf8",
            "Timestamp(Microsecond, Some(\\"UTC\\"))"). Mirrors DataFusion's
            arrow_schema().field(...).data_type() display form.
          type: string
        avg:
          description: |-
            Numeric-only summaries. Null for non-numeric columns.
            q25/q50/q75 are computed via DataFusion approx_percentile_cont; they
            may diverge from polars exact quantiles in edge cases (documented
            parity divergence, see Step 1 acceptance test).
          format: double
          type: number
        columnName:
          description: Column name as it appears in the contract's outputSchema.
          type: string
        distinctCount:
          description: |-
            Distinct count. Exactness governed by
            TableShapeStats.distinctCountsExact. Null when the column type does
            not support COUNT(DISTINCT) (nested List/Struct/Map/Union); absent
            must not be treated as 0 by quality rules or SPC series.
          format: int64
          type: integer
        maxValue:
          type: string
        minValue:
          description: >-
            Min / max as ISO-string-cast values to keep the response
            JSON-friendly.

            Numeric callers parse to f64 at read time. Null when the column has

            zero non-null rows.
          type: string
        nonNullCount:
          description: Non-null row count for the column. Equals rowCount minus null count.
          format: int64
          type: integer
        nullPct:
          description: >-
            Null percentage in [0.0, 100.0], rounded to two decimals to match
            the

            shape_capture writer's behaviour.
          format: double
          type: number
        parableScalar:
          description: >-
            The Parable scalar from the contract outputSchema for this column

            (canonical name like "Identity.UUID" or "Generic.Int64"). New in

            TableShapeStats vs the EDR-0031 ContractColumnStats shape. Null when

            the contract outputSchema does not declare a Parable scalar for the

            column (the Arrow type in `arrowType` is the only signal in that
            case).
          type: string
        q25:
          format: double
          type: number
        q50:
          format: double
          type: number
        q75:
          format: double
          type: number
        std:
          format: double
          type: number
        validationFailureCount:
          description: >-
            Count and percentage of values that failed scalar/contract
            validation for

            this column during the latest maintenance capture.
          format: int64
          type: integer
        validationFailurePct:
          format: double
          type: number
      required:
        - columnName
        - arrowType
        - nonNullCount
        - nullPct
        - validationFailureCount
        - validationFailurePct
      type: object
    DataContractLayerEnum:
      enum:
        - bronze_i
        - bronze_ii
        - silver
        - gold
        - mvo
      type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````