Skip to content

featurebyte.SourceTable.create_item_table

create_item_table(
name: str,
event_id_column: str,
item_id_column: str,
event_table_name: str,
record_creation_timestamp_column: Optional[str]=None,
description: Optional[str]=None
) -> ItemTable

Description

Creates and adds to the catalog an ItemTable object from a source table containing in-depth details about a business event.

To create an Item Table, you need to identify the columns representing the item key and the event key and determine which Event table is associated with the Item table.

After creation, the table can optionally incorporate additional metadata at the column level to further aid feature engineering. This can include identifying columns that identify or reference entities, providing information about the semantics of the table columns, specifying default cleaning operations, or furnishing descriptions of its columns.

Parameters

  • name: str
    The desired name for the new table.

  • event_id_column: str
    The column that represents the unique identifier for the associated event. This column will be used to join the item table with the event table.

  • item_id_column: str
    The column that represents the unique identifier for each item.

  • event_table_name: str
    The name of the event table that the item table will be associated with. This is used to ensure that the item table is properly linked to the correct event table.

  • record_creation_timestamp_column: Optional[str]
    The optional column for the timestamp when a record was created.

  • description: Optional[str]
    The optional description for the new table.

Returns

  • ItemTable
    ItemTable created from the source table.

Examples

Create an item table from a source table.

>>> # Register invoice items as an item table
>>> source_table = ds.get_table(
...     database_name="spark_catalog", schema_name="GROCERY", table_name="INVOICEITEMS"
... )
>>> source_table.create_item_table(
...     name="INVOICEITEMS",
...     event_id_column="GroceryInvoiceGuid",
...     item_id_column="GroceryInvoiceItemGuid",
...     event_table_name="GROCERYINVOICE",
... )