gcloud beta biglake iceberg tables create

NAME
gcloud beta biglake iceberg tables create - create a BigLake Iceberg table
SYNOPSIS
gcloud beta biglake iceberg tables create --create-from-file=CREATE_FROM_FILE (--namespace=NAMESPACE : --catalog=CATALOG) [GCLOUD_WIDE_FLAG]
DESCRIPTION
(BETA) Create a BigLake Iceberg table.
EXAMPLES
To create a table my_table in parent catalog my-catalog and namespace my-namespace using a creation request from table_creation.json, run:
gcloud beta biglake iceberg tables create --namespace=my-namespace --catalog=my-catalog --create-from-file=table_creation.json

The table name and schema fields are required and must be specified in table_creation.json.

Example table_creation.json:

{
  "name": "my_table",
  "location": "gs://my-catalog/my-namespace/my_table",
  "schema": {
    "type": "struct",
    "schema-id": 0,
    "fields": [
      {
        "id": 1,
        "name": "user_id",
        "required": true,
        "type": "long",
        "doc": "Unique identifier for the user"
      },
      {
        "id": 2,
        "name": "username",
        "required": false,
        "type": "string"
      }
    ]
  },
  "partition-spec": {
    "spec-id": 0,
    "fields": [
      {
        "name": "user_id_bucket",
        "transform": "bucket[5]",
        "source-id": 1,
        "partition-id": 1001
      }
    ]
  },
  "write-order": {
    "order-id": 0,
    "fields": [
      {
        "transform": "identity",
        "source-id": 1,
        "direction": "asc",
        "null-order": "nulls-last"
      }
    ]
  },
  "stage-create": false,
  "properties": {
    "owner": "owner",
    "environment": "test",
    "write.format.default": "parquet",
    "comment": "Creating a new table"
  }
}
REQUIRED FLAGS
--create-from-file=CREATE_FROM_FILE
Path to a JSON file containing the table creation request. The format must follow the Apache Iceberg REST Catalog Open API specification for CreateTableRequest. The fields name and schema must be specified.
Namespace resource - The Iceberg Namespace to create. The arguments in this group can be used to specify the attributes of this resource. (NOTE) Some attributes are not given arguments in this group but can be set in other ways.

To set the project attribute:

  • provide the argument --namespace on the command line with a fully specified name;
  • provide the argument --project on the command line;
  • set the property core/project.

This must be specified.

--namespace=NAMESPACE
ID of the namespace or fully qualified identifier for the namespace.

To set the namespace attribute:

  • provide the argument --namespace on the command line.

This flag argument must be specified if any of the other arguments in this group are specified.

--catalog=CATALOG
The Iceberg Catalog for the resource.

To set the catalog attribute:

  • provide the argument --namespace on the command line with a fully specified name;
  • provide the argument --catalog on the command line.
GCLOUD WIDE FLAGS
These flags are available to all commands: --access-token-file, --account, --billing-project, --configuration, --flags-file, --flatten, --format, --help, --impersonate-service-account, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity.

Run $ gcloud help for details.

NOTES
This command is currently in beta and might change without notice. This variant is also available:
gcloud alpha biglake iceberg tables create