Session.create_table(Create an empty table with columns of the given data_types.
name: str,
*,
data_types: Mapping[ColumnName, DataType] =frozendict({}),
default_values: Mapping[ColumnName, Constant | None] =frozendict({}),
keys: AbstractSet[ColumnName] | Sequence[ColumnName] =frozenset({}),
partitioning: str | None =None,
) → Table
Parameters
name
The name of the table to create.data_types
The table column names and their correspondingdata type.
default_values
Mapping from column name to columndefault_value.
keys
The columns that will becomekeys of the table.
If a Set is given, the keys will be ordered as the table columns.
partitioning
The definition of how the data will be split across partitions. Default rules:- Only non-joined tables are automatically partitioned.
- Tables are automatically partitioned by hashing their key columns. If there are no key columns, all the dictionarized columns are hashed.
- Joined tables can only use a sub-partitioning of the table referencing them.
- Automatic partitioning is done modulo the number of available cores.
"modulo4(country)" splits the data across 4 partitions based on the country column’s dictionarized value.