Documentation Index

Fetch the complete documentation index at: https://kb.vastdata.com/llms.txt

Use this file to discover all available pages before exploring further.

table create

Prev Next

This command creates a VAST database table.

Usage

table create --name TABLE
             --schema-name SCHEMA
             --arrow-schema COLUMNS
             --database-name DATABASE 
            [--tenant-id TENANT]   
            [--sorted-column-names SORT_COLUMNS]    
            [--partitions-config PARTITION_COLUMNS]       

Required Parameters

--name TABLE

Specifies the name for the table being created. The name must meet the requirements for S3 object names.

--schema-name SCHEMA

Specifies the name of the schema where the table is to be created.

--arrow-schema COLUMNS

Specifies the columns for the new table, as a comma-separated list.

The columns are specified using the Arrow format, for example: col1-int8,col2-string,col3-int8

Note

Complex data types are not supported on this command. To add a column with a complex data type, use VAST Web UI.

--database-name DATABASE

Specifies the name of the database where the table's schema is created.

Options

--tenant-id TENANT

Specifies the ID of the tenant where the database resides

If omitted, the default tenant is assumed.

--sorted-column-names SORT_COLUMNS

Specifies a comma-separated list of up to four columns that are used to sort the table. Sorting is done according to the order of the names as they appear in the list.

Example --sorted-column-names col1,col2, col3, col4

--partitions-config PARTITION_COLUMNS

Specifies a list of up to four table columns or column transformations that are used to partition the table.

Example ---partitions-config "'day (col1)'"

In this example, col1 is a date or timestamp, and the table is partitioned into 31 partitions, according to the day of the month.

Example --partitions-config "trunctate (col1, 2)"

In this example, if col1 is a number, the table is partitioned into 100 partitions, according to the last two digits of col1.

Example

This example shows adding a table named cats to schema schema1 in database vastdb:

vcli: admin> table create --name cats --schema-name schema1 --arrow-schema name-string,age-int8 --database_name vastdb