Skip to main content

Update table

PUT 

/metalakes/:metalake/catalogs/:catalog/schemas/:schema/tables/:table

Applies one or more changes to a table, such as a rename, property changes or column additions, updates and deletions, and returns the updated table.

Sign in with a bearer token or a local user's password; see Authentication.

Request​

Path Parameters

    metalake stringrequired

    The name of the metalake

    catalog stringrequired

    The name of the catalog

    schema stringrequired

    The name of the schema

    table stringrequired

    The name of the table

Body

    updates

    object[]

    required

  • Array [

  • oneOf

    @type stringrequired

    Possible values: [rename]

    newName stringrequired

    The new name of the table

    newSchemaName stringnullable

    The new schema name of the table, if not provided, the schema will not be changed

  • ]

Responses​

The table, with its columns, partitioning, distribution, sort orders, indexes, comment, properties and audit information.

Schema

    code int32

    Possible values: [0]

    Status code of the response

    table

    object

    A table object

    name stringrequired

    The name of the table

    columns

    object[]

    required

    A list of columns

  • Array [

  • name stringrequired

    The name of the column

    type

    object

    required

    The general, read-compatible data type representation. UnparsedType preserves types that the current server cannot resolve when reading existing metadata. Endpoints that require resolved new metadata use WritableDataType instead.

    oneOf

    The string name of a primitive type, such as boolean, byte, byte unsigned, short, short unsigned, integer, integer unsigned, long, long unsigned, float, double, decimal(10,2), date, time(3), timestamp(3), timestamp_tz(3), string, char(10), varchar(10), interval_day, interval_year, uuid, fixed(16) or binary.

    string

    comment stringnullable

    The comment of the column

    nullable booleannullable

    Default value: true

    Whether the column is nullable

    defaultValue

    object

    oneOf

    type string

    Possible values: [literal]

    dataType

    object

    required

    The general, read-compatible data type representation. UnparsedType preserves types that the current server cannot resolve when reading existing metadata. Endpoints that require resolved new metadata use WritableDataType instead.

    oneOf

    The string name of a primitive type, such as boolean, byte, byte unsigned, short, short unsigned, integer, integer unsigned, long, long unsigned, float, double, decimal(10,2), date, time(3), timestamp(3), timestamp_tz(3), string, char(10), varchar(10), interval_day, interval_year, uuid, fixed(16) or binary.

    string

    value stringrequired

    The string format of the literal value

    autoIncrement booleannullable

    Whether the column is auto increment

  • ]

  • comment stringnullable

    The comment of the table

    audit

    object

    required

    Audit information for a Gravitino resource.

    creator string

    The user who created the resource

    createTime date-time

    The time the resource was created

    lastModifier string

    The user who last modified the resource

    lastModifiedTime date-time

    The time the resource was last modified

    properties

    object

    nullable

    A map of table properties

    property name* string

    distribution

    object

    nullable

    Describes how data is distributed across partitions

    strategy stringnullable

    Possible values: [none, hash, range, even]

    Default value: hash

    The distribution strategy. Responses return the value in lowercase, and a table with no distribution returns none. Requests accept any case, and random is accepted as an alias of even.

    number int32required

    The number of buckets/distribution

    funcArgs

    object[]

    nullable

    required

    The arguments of the distribution function

  • Array [

  • oneOf

    type string

    Possible values: [literal]

    dataType

    object

    required

    The general, read-compatible data type representation. UnparsedType preserves types that the current server cannot resolve when reading existing metadata. Endpoints that require resolved new metadata use WritableDataType instead.

    oneOf

    The string name of a primitive type, such as boolean, byte, byte unsigned, short, short unsigned, integer, integer unsigned, long, long unsigned, float, double, decimal(10,2), date, time(3), timestamp(3), timestamp_tz(3), string, char(10), varchar(10), interval_day, interval_year, uuid, fixed(16) or binary.

    string

    value stringrequired

    The string format of the literal value

  • ]

  • sortOrders

    object[]

    nullable

    Describes the sort order of the table data

  • Array [

  • sortTerm

    object

    required

    oneOf

    type string

    Possible values: [literal]

    dataType

    object

    required

    The general, read-compatible data type representation. UnparsedType preserves types that the current server cannot resolve when reading existing metadata. Endpoints that require resolved new metadata use WritableDataType instead.

    oneOf

    The string name of a primitive type, such as boolean, byte, byte unsigned, short, short unsigned, integer, integer unsigned, long, long unsigned, float, double, decimal(10,2), date, time(3), timestamp(3), timestamp_tz(3), string, char(10), varchar(10), interval_day, interval_year, uuid, fixed(16) or binary.

    string

    value stringrequired

    The string format of the literal value

    direction stringnullable

    Possible values: [asc, desc]

    Default value: asc

    The direction of the sort order

    nullOrdering string

    Possible values: [nulls_first, nulls_last]

    | The sort order of null values. The default value is "nulls_first" if the direction is "asc", otherwise "nulls_last".

  • ]

  • partitioning

    object[]

    nullable

    partitioning of the table data

  • Array [

  • oneOf

    strategy stringrequired

    Possible values: [identity]

    fieldName string[]required

    The name of the field, may be with multiple levels

  • ]

  • indexes

    object[]

    nullable

    Indexes of the table

  • Array [

  • indexType stringrequired

    Possible values: [PRIMARY_KEY, UNIQUE_KEY, SCALAR, BTREE, BITMAP, LABEL_LIST, INVERTED, VECTOR, IVF_FLAT, IVF_SQ, IVF_PQ, IVF_HNSW_SQ, IVF_HNSW_PQ, DATA_SKIPPING_MINMAX, DATA_SKIPPING_BLOOM_FILTER, DATA_SKIPPING_SET]

    The type of the index, one of the values of Index.IndexType. Responses return the value in uppercase; requests accept any case. Which types a table accepts depends on its catalog.

    name stringnullable

    The name of the index

    fieldNames array[]required

    The names of the fields, each field may be with multiple levels

    properties

    object

    Extra index properties (e.g., granularity for ClickHouse data-skipping indexes)

    property name* string
  • ]

Loading...