Functions | |
polars_to_clickhouse_dtype (dtype, nullable) | |
Converts a Polars data type to a valid ClickHouse column type. | |
generate_clickhouse_table (table_name="benchmark.performance") | |
Generates a CREATE TABLE SQL statement for ClickHouse. | |
pipeline.schema_to_clickhouse.generate_clickhouse_table | ( | table_name = "benchmark.performance" | ) |
Generates a CREATE TABLE SQL statement for ClickHouse.
Converts the SCHEMA dictionary into a fully-typed ClickHouse DDL statement. Each field is converted using polars_to_clickhouse_dtype().
table_name | The name of the target ClickHouse table. |
Definition at line 93 of file schema_to_clickhouse.py.
pipeline.schema_to_clickhouse.polars_to_clickhouse_dtype | ( | dtype, | |
nullable ) |
Converts a Polars data type to a valid ClickHouse column type.
This function normalizes the input dtype, whether it's a string (e.g., "Utf8"), a Polars dtype class (e.g., pl.Int64), or an instantiated Polars dtype.
dtype | The input data type (string, Polars class, or Polars dtype object). |
nullable | Whether to wrap the type in ClickHouse's Nullable(). |
ValueError | If the dtype is not supported or recognized. |
Definition at line 52 of file schema_to_clickhouse.py.