StarRocks 4.2 Preview: What's Coming

Herick Rodrigues
.
November 30, 2026
StarRocks 4.2 Preview: What's Coming
Herick Rodrigues
StarRocks 4.2 Preview: What's Coming

StarRocks 4.2 isn't out yet, but the code headed for it already changes two defaults that matter on shared-data clusters, which keep data in object storage: new tables get range distribution unless their DDL says otherwise, and large loads into a new partition can be spread across several compute nodes. It also adds UPDATE and MERGE INTO for Iceberg, which can take Spark out of some upsert pipelines, along with vector indexes on shared-data clusters, AI functions, native geospatial types and new Fluss and Paimon connectors, several of them still experimental or beta. If you run shared-data StarRocks, audit your table DDL before upgrading; the rest can wait for a test environment. There is no release date yet, so names and defaults can still change before it ships.

Addition in 4.2What it does
Range distribution by default (shared-data)New tables without DISTRIBUTED BY get range distribution
Several compute nodes writing one tabletSpreads large INSERT and Broker Load jobs on a single tablet across CNs
Iceberg UPDATE and MERGE INTORow-level changes and upserts on Iceberg v2 tables
Unified incremental materialized view frameworkNew implementation behind refresh_mode = INCREMENTAL
Apache Fluss catalog (experimental)Reads Fluss real-time data together with its tiered lake history
Apache Paimon writes and DDLINSERT, INSERT OVERWRITE, CTAS and catalog DDL on Paimon
Apache Arrow format for Stream LoadLoads Arrow IPC streams without conversion to CSV or JSON
ALTER SYSTEM TRANSFER LEADER (shared-nothing)Moves the FE leader role, normally without a restart
Virtual columns for physical row locationExposes tablet, segment and row IDs in queries
Vector indexes on shared-data with asynchronous build (beta)Approximate nearest-neighbour search on shared-data clusters
AI functions and AI providers (experimental)Calls LLM and embedding endpoints from SQL
Native GEOGRAPHY and GEOMETRY typesSpherical and planar spatial types with ST_ and H3 functions

Range distribution becomes the default for new shared-data tables

In a shared-data cluster, data persists in object storage, compute nodes (CNs) use their local disks only as a cache, and each table is divided into tablets, StarRocks's unit of data distribution. Under range distribution each tablet holds a contiguous range of the sort key, and StarRocks splits a tablet automatically once it grows past a target size (10 GB by default, and new in 4.2, settable per table with the tablet_reshard_target_size property); automatic merging of small tablets exists but is off by default. In 4.1 this was opt-in through the FE configuration enable_range_distribution, which defaulted to false. In 4.2 the default is true, so a table created in shared-data mode without a DISTRIBUTED BY clause gets range distribution.

With the setting at false, a Primary Key table defaults to hash distribution, a Duplicate Key table to random distribution, and Aggregate and Unique Key tables require an explicit clause (FE parameters). Shared-nothing clusters are unaffected. Materialized views follow a separate, new configuration, enable_mv_range_distribution, which defaults to false.

This is the change most likely to surprise a shared-data team, because any DDL template or table-creation tool that omits DISTRIBUTED BY will start producing tables laid out differently from the ones beside them. Audit those templates before you upgrade. If you want to keep the 4.1 behaviour while you evaluate range distribution on a few tables, set the FE configuration back to false:

ADMIN SET FRONTEND CONFIG ("enable_range_distribution" = "false");

The configuration is mutable, so the statement takes effect without a restart; persist it in fe.conf as well so it survives one. Range-distributed tables in 4.2 can also add and drop key columns and carry multiple rollups.

Other defaults that change on shared-data clusters

Several other shared-data settings change their defaults in 4.2. Compaction now splits its work by sort-key range (enable_lake_compaction_range_split, a BE setting) and runs up to 5 parallel subtasks per tablet instead of 3 (lake_compaction_max_parallel_default, an FE setting) (#84218). The single 2 GB metadata cache on each node is replaced by a tablet metadata cache and a segment metadata cache, sized by default at 5% and 10% of the process memory limit, so a lake_metadata_cache_limit entry in be.conf no longer applies (#81943, #83154). New materialized views on shared-data clusters also get file_bundling (#81767).

Two of the new defaults need care during a rolling upgrade. Multi-table batch publish (lake_enable_batch_publish_multi_table, FE) is now on, and an FE older than 4.1.5 replays such batches incorrectly, so when you upgrade from an earlier version, keep it false on the upgraded FEs until every FE runs 4.2 (#82164). Multi-statement transactions now write their logs in a grouped format (lake_enable_txn_vlog_group, BE) that a CN without the new reader cannot parse, and the setting's own documentation says to keep it false on upgraded CNs until every CN has the reader (#84148).

Several compute nodes can write one tablet

Range distribution creates a specific ingestion problem. A new partition starts with a single tablet, because StarRocks has not yet seen the data boundaries that would let it split, so a large INSERT into that partition can send every row to the one CN that owns the tablet. Tablet pre-split, which samples incoming data to split the partition first, often avoids this, but it can be skipped or time out. StarRocks 4.2 lets several compute nodes write one tablet: each CN that runs a sink opens its own writer for the tablet and produces its own segments, and rows that share a key are routed by a hash of the key columns, so they still reach a single node.

The session variable lake_multi_node_tablet_write_mode controls the behaviour (system variables). With off, StarRocks keeps the old write path. The default, auto, applies only to range-distributed tables, and only when the target partition holds fewer tablets than the number of writers the load justifies, while force extends it to hash-bucketed tables. The number of writers is the smallest of the optimizer's estimated load size divided by lake_multi_node_write_bytes_per_node (2 GB by default), lake_multi_node_write_max_nodes (6 by default) and the number of alive CNs. A 10 GB INSERT on a three-CN warehouse therefore gets min(10 / 2, 6, 3) = 3 writers.

Backfills of history and large INSERT INTO ... SELECT jobs into freshly created partitions gain the most, so test with one of those first. The table needs file_bundling (on by default for tables created on 4.0 or later) and combined transaction logs. Broker Load also qualifies, sized from its file list, while Stream Load and Routine Load are excluded on purpose, because neither can be sized at planning time and their batches are usually small. Watch the cost on smaller loads: every node in the write set produces its own segments and its own partial transaction log, so a small load spread widely creates extra small files for little gain.

UPDATE and MERGE INTO for Iceberg tables

StarRocks 4.1 added DELETE for Iceberg, and 4.2 adds UPDATE and MERGE INTO (Iceberg DML). Both use the Iceberg v2 merge-on-read model: the statement writes position-delete files that mark the old rows and new data files that hold the changed rows, and commits them in one Iceberg snapshot. The commit is atomic, and Spark and other Iceberg engines can still read the result.

For teams that run a separate Spark job only because StarRocks could not upsert into Iceberg, this can remove an engine from the write path. A change-data-capture (CDC) feed, in which each source row carries the operation that produced it, maps onto one statement:

MERGE INTO iceberg_catalog.db.customers AS t
USING iceberg_catalog.db.customer_changes AS s
ON t.id = s.id
WHEN MATCHED AND s.op = 'DELETE' THEN DELETE
WHEN MATCHED AND s.op = 'UPDATE' THEN UPDATE SET name = s.name, tier = s.tier
WHEN NOT MATCHED AND s.op <> 'DELETE' THEN
  INSERT (id, name, tier) VALUES (s.id, s.name, s.tier);

The first matching WHEN MATCHED clause wins for each row, and the limits are strict. Only format version 2 tables with Parquet data files are accepted, and v1 and v3 tables are rejected during analysis. UPDATE requires a WHERE clause, and neither statement can change partition columns. MERGE INTO fails at runtime if a target row matches more than one source row, so deduplicate the source first; in a CDC feed that usually means keeping only the latest change per key. Concurrent writers are checked at commit time, and a conflicting UPDATE fails instead of overwriting, so a job that shares a table with Spark writers needs retry logic.

DELETE on Iceberg also gains WITH, USING and FOR VERSION AS OF <branch>, and StarRocks can now read shredded VARIANT columns from Iceberg Parquet files.

Incremental materialized views on a new framework

An incremental materialized view (IVM) is refreshed by applying only the base-table changes since the last refresh, instead of recomputing whole partitions. StarRocks 4.1.0 introduced refresh_mode = INCREMENTAL for Iceberg append-only tables, and 4.2 moves the implementation to a unified framework built from delta and version operators plus rewrite rules for aggregates, joins and unions. Every incremental view is now a Primary Key table keyed by an internal row-id column, incremental views can use range distribution, and each refresh task records the source version and timestamp range it consumed, which makes a refresh auditable.

The scope remains narrow (CREATE MATERIALIZED VIEW). Iceberg is the only supported base table type, and only append-only changes are accepted: an UPDATE, MERGE or OVERWRITE on the base table makes the refresh fail. Outer joins, a join after an aggregation and a UNION ALL after an aggregation are not supported. Teams with append-only Iceberg fact tables and aggregate views over them should try incremental refresh on one such view first and use the recorded version ranges to verify each refresh. Do not adopt MERGE INTO on a table that feeds an incremental view, because the first upsert breaks the view's refresh.

Fluss reads and Paimon writes

A new fluss catalog type reads Apache Fluss tables. Fluss is a streaming storage layer that keeps recent data itself and tiers older data into a lake format. By default a StarRocks query returns the union of the real-time data in Fluss and the history already tiered to the lake, while appending $lake to the table name reads only the lake part and $rt only the real-time part. The catalog is experimental and works only for tables that have DataLake enabled with Apache Paimon as the lake storage (Fluss catalog). With Fluss and Paimon tiering already in place, you can query fresh and historical data in one statement, and comparing the default read with the $lake read on the same table is a simple first test.

Paimon itself gains a write path: INSERT INTO, INSERT OVERWRITE, CREATE TABLE AS SELECT and native catalog DDL. Writes require Parquet data files, and Primary Key tables need a fixed bucket count and the deduplicate merge engine; UPDATE and DELETE are not supported (Paimon catalog). That covers append and overwrite pipelines; row-level changes on Paimon still need another engine.

Apache Arrow format for Stream Load

Stream Load, the HTTP load interface most connectors use, accepts Apache Arrow as a native format when the format parameter is arrow. The reader consumes the Arrow IPC streaming format, so a producer that already holds Arrow record batches, such as a Python service built on pandas or Polars, can send them without first converting to CSV or JSON. Arrow is supported for Stream Load only; INSERT from FILES, Broker Load and Routine Load do not read it yet (loading feature matrix).

Planned FE leader transfer on shared-nothing clusters

The frontend (FE) nodes hold the cluster metadata, and one of them, the leader, accepts all metadata writes. Until now, moving the leader role for maintenance meant restarting the current leader and letting the followers elect a new one. Shared-nothing clusters on 4.2 can hand the role over with a planned transfer:

ALTER SYSTEM TRANSFER LEADER TO "FE_HOST:EDIT_LOG_PORT";

The target must be an alive follower. If it cannot catch up within an internal 30-second window, the statement returns an error and the current leader stays in place, so the statement is safe to retry. If the transfer succeeds, the old leader becomes a follower in place; only if it cannot drain its in-flight work within leader_demotion_drain_timeout_sec (180 seconds by default) does its process exit and restart as a follower. FORCE supersedes a transfer already in progress (ALTER SYSTEM). Anyone who patches FE hosts on a schedule should build this into the runbook, moving the leader off a host before taking it down. Shared-data clusters reject the statement, so there you still restart the leader to force an election.

Virtual columns that show where each row is stored

Native tables now expose virtual columns that describe the physical location of each row: _tablet_id_ (#66214), _segment_id_ and _row_id_ (#68938), and others such as _rowset_id_ and _source_id_, the node the row was read from. Questions that used to require reading tablet metadata, such as whether the bucketing key spreads rows evenly, become an ordinary GROUP BY:

-- Rows and value range per tablet, to spot skew from the bucketing key
SELECT
  _tablet_id_,
  COUNT(*)     AS row_count,
  MIN(user_id) AS min_user_id,
  MAX(user_id) AS max_user_id,
  NDV(user_id) AS ndv_user_id
FROM events
GROUP BY _tablet_id_
ORDER BY row_count DESC;

The count is aliased row_count because ROWS is a reserved word in the StarRocks grammar. This is the first query we would run on any table suspected of skew. Virtual columns do not appear in SELECT *, and a filter on one is evaluated during the scan, so WHERE _tablet_id_ = ... does not reduce the set of tablets read. Their values change after compaction, loads, schema changes and replica migration, so use them for diagnosis and never store them as keys. Setting the FE configuration enable_virtual_columns (default true) to false disables them cluster-wide.

Vector indexes on shared-data clusters

A vector index accelerates approximate nearest-neighbour search over embedding columns of type ARRAY<FLOAT>. In 4.1, vector indexes were limited to shared-nothing clusters and required the FE configuration enable_experimental_vector. Version 4.2 introduces shared-data vector indexes with asynchronous build and removes that configuration. With "index_build_mode" = "async", StarRocks builds the index in the background after each write; until the build finishes, queries over those segments fall back to brute-force search.

That fallback is what to watch when you test it. Build progress is visible in information_schema.partitions_meta: a partition whose MIN_VI_BUILT_VERSION is lower than its VISIBLE_VERSION still has segments without an index. On clusters with steady ingestion, set the FE configuration lake_vector_index_build_warehouse to move builds to a dedicated warehouse, which keeps them away from query capacity. Version 4.2 also adds an inner_product metric and filtered search with pre-filtering. The feature is labelled beta (vector index), so keep it to proofs of concept for now.

AI functions and AI providers

StarRocks 4.1.0 shipped one AI function, ai_query. Version 4.2 adds an experimental family built on an asynchronous execution framework: ai_complete and ai_embed, plus text helpers such as ai_classify, ai_extract, ai_summarize, ai_translate and ai_filter. Endpoints and credentials live in a cluster-level object created with CREATE AI PROVIDER, so they stay out of SQL text:

CREATE AI PROVIDER openai TYPE embedding
PROPERTIES (
    "endpoint"   = "https://api.openai.com/v1/embeddings",
    "model"      = "text-embedding-3-small",
    "dimensions" = "1536",
    "api_key"    = "YOUR_API_KEY"
);

SELECT id, ai_embed(input => body, provider => 'openai') AS embedding
FROM support_tickets
LIMIT 10;

ai_embed returns ARRAY<FLOAT>, the element type a vector index uses, so embedding and search can live in one system; the indexed column must be declared ARRAY<FLOAT> NOT NULL with a fixed dimension. A caller needs privileges on both the function and the provider. Providers speak either the OpenAI-compatible openai protocol or Alibaba Cloud Model Studio's native dashscope protocol. A new FILE type passes images and video to ai_complete and ai_embed.

Put this through a security review before anyone enables it on a cluster with sensitive data (CREATE AI PROVIDER). The API key is stored in the FE metadata journal and image, readable by anyone with access to those files, and every input row is sent to the provider endpoint. Grant provider privileges narrowly, and keep a LIMIT on exploratory queries like the one above, because each row is a call to an external endpoint.

Native geospatial types

Native GEOGRAPHY and GEOMETRY types are new in 4.2 (#79005, #78999). GEOGRAPHY uses the OGC:CRS84 reference system with spherical edges and SRID 4326, which suits global latitude and longitude data. GEOMETRY is planar and carries an explicit coordinate reference system with no default. Constructors such as ST_GeogFromText and ST_GeomFromWKB, predicates such as ST_Contains (point in polygon only) and ST_Intersects, and seven H3 grid functions are listed in the native GEO function matrix. GEOGRAPHY and GEOMETRY columns can also be read from Iceberg, including nested ones.

The biggest gain is for location data kept in Iceberg and queried today with a separate spatial engine. Check reprojection first, because it is limited: ST_Transform converts GEOMETRY between EPSG:4326 and EPSG:3857 (Web Mercator) only, so data in a national or UTM projection has to be converted before it reaches StarRocks.

What to check before upgrading to 4.2

On shared-data clusters, plan the rolling upgrade first: keep lake_enable_txn_vlog_group at false on the CNs until every CN runs 4.2, and if you are coming from a version older than 4.1.5, do the same with lake_enable_batch_publish_multi_table on the FEs. Then audit every DDL template and tool that omits DISTRIBUTED BY, and decide whether new tables should get range distribution or whether enable_range_distribution goes back to false until you have tested it. Finally, decide whether lake_multi_node_tablet_write_mode stays at auto for your large INSERT jobs into new partitions, based on a test with your biggest batch load.

Teams that run Iceberg upserts in Spark should list which of those jobs could move to MERGE INTO and test the most important one first. Virtual columns and the planned leader transfer are worth adopting early, since they only add ways to inspect and operate a cluster. Vector search, AI functions, geospatial types and the Fluss and Paimon connectors deserve a proof of concept before anyone depends on them. To try any of this before the release, build from branch-4.2 and use the docs under docs/en on that branch.

Written against StarRocks branch-4.2, November 2026. Reviewed by Deep.BI's engineering team.

Running StarRocks in production? Our engineers support it 24/7, on the version you run. See StarRocks support.

Subscribe and stay in the loop with the latest on Druid, Flink, and more!

Thank you for joining our newsletter!
Oops! Something went wrong while submitting the form.
Deep.BI needs the contact information you provide to contact you. You may unsubscribe at any time. For information on how to unsubscribe and more, please review our Privacy Policy.

You Might Also Like