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 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.
--schema
Required
A JSON schema definition for the table. The schema follows the Iceberg schema specification with type definitions and field properties.
Example:
{"type":"struct","fields":[{"id":1,"name":"id","type":"long","required":true}]}
--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.
Global flags
This command supports any of the global flags.
Examples
Create a table with a schema
Use mc table create to create a new table:
mc table create ALIAS WAREHOUSE NAMESPACE TABLE \
--schema '{"type":"struct","fields":[{"id":1,"name":"id","type":"long","required":true}]}'
- 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 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 \
--schema '{"type":"struct","fields":[{"id":1,"name":"id","type":"long","required":true}]}'