StarRocksDest
class StarRocksDest(
conn: StarRocksConn,
destination_tables: str | list[str],
if_table_exists: IfTableExistStrategySpec = 'append',
schema_evolution: SchemaEvolutionSpec = 'none',
)
Bases: DestinationPlugin
Categories: destination
Destination plugin for writing data to StarRocks using cloud-staged bulk loading.
Data is first written as Parquet files to the configured cloud storage staging area
(S3, Azure Blob, or GCS) and then ingested into StarRocks via its FILES()
table function in an INSERT INTO … SELECT * FROM FILES(...) statement.
Initialize a StarRocksDest instance for writing data to StarRocks.
Parameters
connThe StarRocks connection configuration, including both the server parameters and the cloud staging configuration.
destination_tablesThe table(s) to load data into. A single table name may be provided as a string; multiple tables must be a list of strings.
if_table_existsThe strategy to follow when the table already exists. Defaults to 'append'. * 'append' — insert new rows into the existing table. * 'replace' — truncate the table before loading new rows.
schema_evolutionThe schema evolution strategy to use when the incoming data schema differs from the existing table schema. Defaults to 'none'. * 'none' — raise an error if the schema does not match. * 'iceberg' — apply Iceberg-style schema evolution (add columns, drop columns, widen types, make columns nullable).
Properties
connStarRocksConnThe StarRocks connection configuration.
destination_tableslist[str]The table(s) to load data into.
if_table_existsIfTableExistStrategySpecThe strategy to follow when the table already exists.
schema_evolutionSchemaEvolutionSpecThe schema evolution strategy.
Methods
streamdef stream(working_dir: str, *results: list[LazyFrame | None])
Write each result as a Parquet file and bulk load it into StarRocks via the cloud staging area.
Parameters:
working_dirTemporary directory for intermediate Parquet files.
resultsOne polars LazyFrame (or None) per destination table, in the same order as destination_tables.