maxframe.liteframe.LiteFrame.to_odps_table#

LiteFrame.to_odps_table(table: Table | str, partition: str | None = None, partition_col: None | str | List[str] = None, mode: str = 'overwrite', unknown_as_string: bool | None = True, lifecycle: int | None = None, table_properties: dict | None = None, primary_key: None | str | List[str] = None, odps_types: Dict[str, str] | None = None)#

Write LiteFrame object into a MaxCompute (ODPS) table.

Parameters:
  • table (odps.models.Table or str) – ODPS table or table name to write to.

  • partition (str, optional) – Partition spec for the target table (e.g. “ds=20240101”).

  • partition_col (str or list of str, optional) – Column name(s) to use as partition columns. The data is partitioned by these columns.

  • mode ({'overwrite', 'append'}, default 'overwrite') – Write mode. ‘overwrite’ drops the existing data; ‘append’ adds to it.

  • unknown_as_string (bool, default True) – If True, columns with unknown ODPS types are written as strings.

  • lifecycle (int, optional) – Table lifecycle in days.

  • table_properties (dict, optional) – ODPS table properties.

  • primary_key (str or list of str, optional) – Column name(s) to set as the table primary key.

  • odps_types (dict, optional) – Mapping of column name to ODPS type string, used to override auto-detected types.

Returns:

Stub LiteFrame for execution.

Return type:

LiteFrame

See also

read_odps_table

Read an ODPS table into a LiteFrame.

to_parquet

Write a LiteFrame to a Parquet file.