Skip to main content

Replace a view

POST 

/v1/:prefix/namespaces/:namespace/views/:view

Commit updates to a view.

Request​

Path Parameters

    prefix stringrequired

    The catalog name in Gravitino, as returned in defaults.prefix by GET /v1/config

    namespace stringrequired

    A namespace identifier as a single string. Multipart namespace parts must be separated by the namespace separator as indicated via the /config override namespace-separator, which defaults to the unit separator 0x1F byte (url encoded %1F). To be compatible with older clients, servers must use both the advertised separator and 0x1F as valid separators when decoding namespaces. The namespace-separator should be provided in a url encoded form.

    Examples:

    Example: accounting

    view stringrequired

    A view name

    Example: sales

Header Parameters

    Idempotency-Key uuid

    Possible values: >= 36 characters and <= 36 characters

    Optional client-provided idempotency key for safe request retries.

    When present, the server ensures no additional effects for requests that carry the same Idempotency-Key. If a prior request with this key has been finalized, the server returns an equivalent final response without re-running the operation. The response body may reflect a newer state of the catalog than existed at the time of the commit.

    Finalization rules:

    • Finalize & replay: 200, 201, 204, and deterministic terminal 4xx (including 409 such as AlreadyExists, NamespaceNotEmpty, etc.)
    • Do not finalize (not stored/replayed): 5xx

    Key Requirements:

    • Key format: UUIDv7 in string form (RFC 9562).
    • The idempotency key must be globally unique (no reuse across different operations).
    • Catalogs SHOULD NOT expire keys before the end of the advertised token lifetime.
    • If Idempotency-Key is used, clients MUST reuse the same key when retrying the same logical operation and MUST generate a new key for a different operation.

Body

required

    identifier

    object

    View identifier to update

    namespace string[]required

    Reference to one or more levels of a namespace

    name stringrequired

    requirements

    object[]

  • Array [

  • oneOf

    The view UUID must match the requirement's uuid

    type stringrequired
    uuid stringrequired
  • ]

  • updates

    object[]

    required

  • Array [

  • anyOf

    Assigning a UUID to a table/view should only be done when creating the table/view. It is not safe to re-assign the UUID if a table/view already has a UUID assigned

    action string
    uuid stringrequired

    action

    string

    required

    Possible values: [assign-uuid, upgrade-format-version, add-schema, set-current-schema, add-spec, set-default-spec, add-sort-order, set-default-sort-order, add-snapshot, set-snapshot-ref, remove-snapshots, remove-snapshot-ref, set-location, set-properties, remove-properties, add-view-version, set-current-view-version, set-statistics, remove-statistics, set-partition-statistics, remove-partition-statistics, remove-partition-specs, remove-schemas, add-encryption-key, remove-encryption-key]

    circular(AssignUUIDUpdate)

  • ]

Responses​

View metadata result when loading a view

Schema

    metadata-location stringrequired

    metadata

    object

    required

    view-uuid stringrequired
    format-version integerrequired

    Possible values: >= 1 and <= 1

    location stringrequired
    current-version-id integerrequired

    versions

    object[]

    required

  • Array [

  • version-id integerrequired
    timestamp-ms int64required
    schema-id integerrequired

    Schema ID to set as current, or -1 to set last added schema

    summary

    object

    required

    property name* string

    representations

    object[]

    required

  • Array [

  • oneOf

    type stringrequired
    sql stringrequired
    dialect stringrequired
  • ]

  • default-catalog string
    default-namespace string[]required

    Reference to one or more levels of a namespace

  • ]

  • version-log

    object[]

    required

  • Array [

  • version-id integerrequired
    timestamp-ms int64required
  • ]

  • schemas object[]required

    properties

    object

    property name* string

    config

    object

    property name* string
Loading...