Buckets

Create a table alias in a bucket

Creates an alias table in the given bucket over a table from another bucket. The alias can expose a subset of the source columns and can be restricted by a filter. On backends that keep a persisted VIEW for aliases the work is delegated to an asynchronous job, otherwise the alias is created directly and returned with 201.

An alias cannot be created from a table that lives in an external bucket or in a development branch. Additionally, the destination bucket itself cannot be an external bucket or a development branch bucket.

Initial response returns job details JobResponse. The result of the asynchronous job can be fetched via /v2/storage/jobs/{id}. When the job completes, final result is AliasCreateJobResult.

Parameters of job will be AliasCreateJobParams.

This endpoint can be used synchronously as well. In that case, the final result is returned directly in the response CreateTableAliasResponse.

post/v2/storage/buckets/{bucketId}/table-aliases

Request

Path parameters

bucketIdstring required

Identifier of the bucket the alias is created in.

Request body

sourceTablestring required

Id of the table the alias reads from (e.g. in.c-main.users).

namestring nullable

Name of the new alias table. Defaults to the source table name.

aliasColumnsstring[] nullable

Columns exposed by the alias. When omitted the alias mirrors all source columns and keeps them in sync.

aliasColumnsAutosyncboolean nullable

Deprecated and ignored - auto-sync is derived from whether aliasColumns is given.

Response

The created alias detail, including its columns and the destination bucket detail.

uristring required

Table API URI

idstring required

Table ID

namestring required

Table name

displayNamestring required

Table display name

transactionalboolean required

Is transactional

primaryKeystring[] required

Primary key columns

indexTypestring nullable required

Index type

indexKeystring[] required

Index key columns

distributionTypestring nullable required

Distribution type

distributionKeystring[] required

Distribution key columns

syntheticPrimaryKeyEnabledboolean required

Synthetic primary key enabled

createdstring nullable required

Created timestamp, ISO 8601 with a +hhmm offset.

lastImportDatestring nullable required

Last import date, ISO 8601 with a +hhmm offset.

lastChangeDatestring nullable required

Last change date, ISO 8601 with a +hhmm offset.

rowsCountinteger nullable required

Rows count

dataSizeBytesinteger nullable required

Data size in bytes

isAliasboolean required

Is alias

isAliasableboolean required

Is aliasable

isTypedboolean required

Is typed table

isDescriptionSystemManagedboolean required

Whether the description is managed by the system

timestampType'MANAGED' | 'SELFMANAGED' | 'NONE' required

How the _timestamp column is managed

tableTypestring required

Table type

pathstring required

Table path

columnsstring[] required

Names of the columns exposed by the alias.

aliasColumnsAutoSyncboolean

Alias columns auto sync. Present only for simple aliases.

selectSqlstring

Custom SQL of the alias. Present only for custom SQL aliases.

isPersistedboolean

Whether the alias is persisted as a table in the backend. Present only for aliases.

Example response

{
  "created": "2017-02-13T12:01:05+0100",
  "lastImportDate": "2017-02-13T12:01:05+0100",
  "lastChangeDate": "2017-02-13T12:01:05+0100",
  "bucket": {
    "uri": "https://connection.keboola.com/v2/storage/buckets/in.c-my-new-bucket",
    "id": "in.c-my-new-bucket",
    "name": "c-my-new-bucket",
    "displayName": "my-new-bucket",
    "idBranch": 1234,
    "stage": "in",
    "description": "Some Description",
    "tables": "https://connection.keboola.com/v2/storage/buckets/in.c-my-new-bucket",
    "created": "2017-02-13T12:01:05+0100",
    "updated": "2024-11-28T13:03:13+0100",
    "backend": "snowflake",
    "path": "database_name.c-my-new-bucket",
    "bucketSharingAllowed": true,
    "sharingParameters": {
      "projects": [
        {
          "id": 321,
          "name": "Some Project"
        }
      ],
      "users": [
        {
          "id": 5,
          "name": "Jan Developer",
          "email": "jan.dev@keboola.com"
        }
      ]
    },
    "sharedBy": {
      "id": 5,
      "name": "dev@keboola.com",
      "date": "2020-02-03T14:58:29+0100"
    },
    "owner": {
      "id": 123,
      "name": "Jan Developer",
      "email": "jan.dev@keboola.com"
    },
    "sourceBucket": {
      "id": "in.c-main",
      "name": "c-main",
      "displayName": "main",
      "stage": "in",
      "description": "Organization shared data",
      "sharing": "organization-project",
      "created": "2020-01-12T18:28:31+0100",
      "lastChangeDate": "2020-01-12T18:31:49+0100",
      "dataSizeBytes": 1536,
      "rowsCount": 32,
      "backend": "snowflake",
      "path": "database_name.c-main",
      "project": {
        "id": 123,
        "name": "Project name"
      },
      "tables": [
        {
          "id": "in.c-main.languages",
          "name": "languages",
          "displayName": "languages-display-name",
          "path": "/1234-languages"
        }
      ],
      "sharingParameters": {
        "projects": [
          {
            "id": 321,
            "name": "Some Project"
          }
        ],
        "users": [
          {
            "id": 5,
            "name": "Jan Developer",
            "email": "jan.dev@keboola.com"
          }
        ]
      },
      "sharedBy": {
        "id": 5,
        "name": "dev@keboola.com",
        "date": "2020-02-03T14:58:29+0100"
      },
      "owner": {
        "id": 123,
        "name": "Jan Developer",
        "email": "jan.dev@keboola.com"
      },
      "metadata": [
        {
          "id": "19509",
          "key": "some-key",
          "value": "Some value",
          "provider": "test-component",
          "timestamp": "2017-02-13T23:36:10+0100"
        }
      ]
    },
    "backendPath": [
      "KBC_PRJ_123",
      "in.c-my-new-bucket"
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.