Updated on 2025-12-19 GMT+08:00

Table APIs

insert(data, overwrite=False)

Description: Inserts a dataset into a database table.

Input parameters:

  • data (dataset.Dataset): Dataset object to insert. Must be of type fabric_data.multimodal.dataset.Dataset.
  • overwrite (bool): Whether to overwrite existing data. Default is False.

Return type: None.

show(limit=10)

Description: Displays the first N rows of a table.

Input parameters:

limit(int): Limits the number of rows to display. Defaults to 10.

Return type: None.

to_dataset()

Description: Converts the current table object into a dataset object.

Input parameters: None.

Return type: dataset.

add_columns(new_cols)

Description: Adds one or more columns to a table.

Input parameters:

new_cols (Dict[str, str]): A dictionary where keys are column names (str) and values are column types (str).

Return type: None.

drop_columns(*columns)

Description: Removes one or more columns from a table.

Input parameters:

*columns (str): Names of the columns to remove. Accepts multiple string arguments.

Return type: None.

alter_column_type(column_name, new_type)

Description: Changes the data type of a specified column in a table.

Input parameters:

  • column_name (str): Name of the column to change.
  • new_type (str): New data type for the column.

Return type: None.

rename_column(column_name, new_name)

Description: Renames a column in a table.

Input parameters:

  • column_name (str): Current name of the column.
  • new_type (str): New name for the column.

Return type: None.

delete(where)

Description: Deletes rows from a table that meet the specified condition.

Input parameters:

where (str): A SQL WHERE clause defining the deletion criteria.

Return type: None.

update(values_expr, where)

Description: Updates rows in a table that satisfy the given conditions.

Input parameters:

  • values_expr (Dict[str, ValueExpression]): A dictionary where keys are column names (str) and values are update expressions (str).
  • where (Union[ir.BooleanValue, list[ir.BooleanValue], IfAnyAll, None]): Conditions to filter rows for updating. If None, all rows are updated.

Return type: None.