Skip to content

BatchRequestTable

A BatchRequestTable object is a representation of a table in the feature store that specifies entity values for batch serving.

Creating BatchRequestTable Objects

A BatchRequestTable object can be created from either a SourceTable object or a View object.

Note

An accepted serving name must be used for the column containing the entity values.

If you want to create an BatchRequestTable object from a SourceTable object,

  1. First select the relevant source table from the feature store.
    ds = fb.FeatureStore.get(<feature_store_name>).get_data_source()
    source_table = ds.get_source_table(
        database_name=<data_base_name>,
        schema_name=<schema_name>,
        table_name=<table_name>
    )
    
  2. Then use the create_batch_request_table method to create the BatchRequestTable object. Select the entity columns and use the columns_rename_mapping parameter if the column names are different from an accepted serving name. Make sure to specify the batch request table name:
    batch_request_table = source_table.create_batch_request_table(
        name=<batch_request_table_name>,
        columns=[<entity_column_name>],
        columns_rename_mapping={
            <entity_column_name>: <entity_serving_name>,
        }
    )
    

To create an BatchRequestTable object from an existing View object, use the create_batch_request_table method. Select the entity columns and use the columns_rename_mapping parameter if the column names are different from an accepted serving name:

batch_request_table = view.create_batch_request_table(
    name=<batch_request_table_name>
    columns=[<entity_column_name>],
    columns_rename_mapping={
        <entity_column_name>: <entity_serving_name>,
    }
)

You can download the table by using the download() method:

batch_request_table.download()
You can convert the table to a Pandas DataFrame by using the to_pandas() method:
batch_request_table.to_pandas()

If you no longer need an BatchRequestTable object and it is not used by any BatchFeatureTable object, you can delete it using the delete() method. This will delete the table in the feature store.

batch_request_table.delete()

Listing and Retrieving BatchRequestTable Objects

To list the BatchRequestTable objects in the catalog, use the list_batch_request_tables() method:

catalog.list_batch_request_tables()

To retrieve a specific BatchRequestTable by its name from the catalog, use the get_batch_request_table() method:

batch_request_table = catalog.get_batch_request_table(<batch_request_table_name>)

To retrieve a specific BatchRequestTable by its Object ID from the catalog, use the get_batch_request_table_by_id() method:

batch_request_table = catalog.get_batch_request_table_by_id(<batch_request_table_id>)