Updated on 2025-09-18 GMT+08:00

DataFrame create_table Function Usage

create_table is used to create a table in DataArts Fabric. The function signature is as follows:

def create_table(
    self,
    name: str,
    obj: Optional[Union[ir.Table, pd.DataFrame, pa.Table, pl.DataFrame, pl.LazyFrame]] = None,
    *,
    schema: Optional[ibis.Schema] = None,
    database: Optional[str] = None,
    temp: bool = False,
    external: bool = False,
    overwrite: bool = False,
    partition_by: Optional[ibis.Schema] = None,
    table_properties: Optional[dict] = None,
    store: Optional[str] = None,
    location: Optional[str] = None
)
Table 1 Parameter descriptions

Parameter

Type

Mandatory

Description

name

str

Yes

Name of the table to be created.

obj

ir.Table|pd.DataFrame|pa.Table|pl.DataFrame|pl.LazyFrame

No

Data used to fill in the table. At least one of obj or schema must be specified (currently, inserting data while creating a table is not supported).

schema

sch.SchemaLike

No

Schema of the table to be created. At least one of obj or schema must be specified.

database

str

No

Name of the database where the table is created. If left unset, the current database is used.

temp

bool

No

Whether to create a temporary table. The default value is False.

external

bool

No

Whether to create a foreign table. The default value is False.

overwrite

bool

No

If set to True, the table is replaced if it already exists. The default value is False (currently, overwriting tables is not supported).

partition_by

sch.SchemaLike

No

Specifies a partition column; columns appearing in the partition column cannot appear in the regular column descriptions of the table.

table_properties

dict

No

Optional setting parameters at the table level. For details about the supported parameter ranges, see Table 1.

store

str

No

Table storage formats, supporting ORC, PARQUET, HUDI, and ICEBERG.

location

str

No

Table storage path. The value must be a valid OBS path. OBS buckets and parallel file systems are supported.

  • If the path is an OBS bucket path, the table is read-only. Otherwise, the table can be read and written.
  • If the table to be created is a managed table, the table storage path cannot be specified. The table storage path is specified by the system as the path with the same name as the table name in the schema path, and the path must be empty during table creation.