atoti_directquery_bigquery.vectorized_table_options module#

class atoti_directquery_bigquery.BigqueryVectorizedTableOptions#

Options to create a vectorized table from a BigQuery database.

Example

>>> from atoti_directquery_bigquery import BigqueryVectorizedTableOptions
>>> external_table = external_database.tables[
...     "test_resources", "vect_products"
... ]
>>> table = session.add_external_table(
...     external_table,
...     options=BigqueryVectorizedTableOptions(
...         index_column="idx",
...         vector_columns=["vect_price", "vect_quantity"],
...     ),
... )
>>> table.head()
                                         vect_price            vect_quantity
product date
p1      2021-07-20     [10.0, 12.0, 14.0, 8.0, 9.0]  [101, 80, 71, 115, 109]
        2021-07-19     [10.0, 11.0, 12.0, 9.0, 9.0]  [100, 89, 86, 120, 120]
        2021-07-21     [10.0, 11.0, 15.0, 8.7, 9.9]   [99, 85, 60, 121, 108]
p2      2021-07-19   [21.0, 20.0, 22.0, 20.3, 15.0]     [73, 78, 68, 79, 98]
        2021-07-20  [27.0, 20.0, 21.0, 20.87, 17.0]     [56, 69, 72, 68, 97]
index_column: str#

Name of the column used as an index for the vectors.

vector_columns: Sequence[str]#

Names of the columns that contain the vectors values.