mc table create
The mc table create command creates a new Iceberg table on an AIStor cluster.
Tables are created within a namespace and can have a schema definition and custom properties.
Parameters
ALIAS
Required
The alias of an AIStor cluster on which to create the table.
NAMESPACE
Required
The name of the namespace in which to create the table.
TABLE
Required
The name of the table to create.
WAREHOUSE
Required
The name of the warehouse containing the target namespace.
--attr
Alias: -a
Optional
Add a custom property for the table in key=value format.
You can specify multiple --attr parameters to add multiple properties.
--ignore-existing
Alias: -p
Optional
Do not return an error if a table with the specified name already exists.
--schema
Optional
A JSON schema definition for the table. The schema follows the Iceberg schema specification with type definitions and field properties.
If not provided, AIStor creates a default schema.
Example:
{"type":"struct","fields":[{"id":1,"name":"id","type":"long","required":true}]}
Global flags
This command supports any of the global flags.
Examples
Create a table with the default schema
Use mc table create to create a new table:
mc table create ALIAS WAREHOUSE NAMESPACE TABLE
- Replace
ALIASwith the alias of the AIStor cluster. - Replace
WAREHOUSEwith the name of the warehouse. - Replace
NAMESPACEwith the name of the namespace. - Replace
TABLEwith the name for the new table.
Create a table with a custom schema
Use the --schema flag to specify a custom schema:
mc table create myaistor analytics prod sales_data --schema '{"type":"struct","fields":[{"id":1,"name":"id","type":"long","required":true}]}'
Create a table with custom properties
Use the --attr flag to add custom properties when creating a table:
mc table create myaistor analytics prod sales_data --attr owner=data-team --attr env=production