Sumit N
01/18/2026, 5:45 AMRocky
03/17/2026, 2:27 PMKalyan Kumar
03/17/2026, 2:27 PMRocky
03/17/2026, 2:27 PMDELETE is not currently supported on JDBC catalogs in StarRocks.
While StarRocks has expanded the capabilities of JDBC catalogs to support some write operations, here is the current status:
* Supported: You can use INSERT INTO to load or transform and write data back to the target database through a JDBC catalog (supported since v3.0).
* Not Supported: DELETE and UPDATE statements are not supported for tables in a JDBC catalog. These DML operations are primarily supported for StarRocks internal tables (such as Primary Key or Duplicate Key tables).
If you attempt to run a DELETE statement on a table within a JDBC catalog, you will typically encounter an error indicating that the operation is only supported on internal (OLAP) tables.
Workaround
If you need to perform deletions in the source database based on logic within StarRocks, you would typically need to:
1. Perform the deletion directly on the source database (e.g., MySQL, PostgreSQL) using its own client.
2. If the deletion is part of a data synchronization logic, consider using a specialized ETL tool or an CDC (Change Data Capture) pipeline to keep the data in sync.
References
• data_source/catalog/jdbc_catalog.md
• sql-reference/sql-statements/Catalog/DROP_CATALOG.md
• data_source/catalog/unified_catalog.md
• data_source/External_table.md
• data_source/catalog/hive_catalog.mdKalyan Kumar
03/26/2026, 5:19 AMRocky
03/26/2026, 5:20 AMKalyan Kumar
03/26/2026, 5:35 AMRocky
03/26/2026, 5:36 AMsql
CREATE EXTERNAL CATALOG polaris_catalog
PROPERTIES (
"type" = "iceberg",
"iceberg.catalog.type" = "rest",
"iceberg.catalog.uri" = "http://<polaris-host>:8181/api/catalog",
"iceberg.catalog.warehouse" = "your_warehouse_name",
"iceberg.catalog.security" = "oauth2",
"iceberg.catalog.oauth2.credential" = "your_credential",
"iceberg.catalog.oauth2.scope" = "PRINCIPAL_ROLE:ALL"
);
2. Create the Iceberg Table
Create a table within that Iceberg catalog. This table will physically reside on your shared storage (e.g., S3) in Iceberg format:
sql
CREATE TABLE polaris_catalog.your_db.exported_table (
id BIGINT,
data STRING
)
ENGINE=ICEBERG;
3. Sync Data from Native to Iceberg
Use an INSERT INTO ... SELECT statement to move or synchronize data from your StarRocks native table to the Iceberg table:
sql
INSERT INTO polaris_catalog.your_db.exported_table
SELECT * FROM default_catalog.your_db.native_table;
Summary
* Existing Native Tables: Cannot be exposed directly via Polaris because they are local and proprietary.
* Managed Iceberg Tables: Since StarRocks v3.3+, you can perform DML (Insert, Update, Delete) on Iceberg tables. By maintaining a copy of your data in an Iceberg catalog through StarRocks, that data becomes "exposed" and queryable by any tool connected to Polaris (Spark, Trino, etc.) outside of the cluster.
References
• data_source/catalog/iceberg/iceberg_catalog.md
• data_source/catalog/iceberg/iceberg_rest_s3.md
• data_source/catalog/iceberg/iceberg_rest_security.mdKalyan Kumar
03/26/2026, 6:03 AMRocky
03/26/2026, 6:04 AMINSERT INTO and INSERT OVERWRITE) are supported for Iceberg tables. Polaris uses the Iceberg REST catalog interface, which StarRocks supports natively.
1. Connecting to Polaris
To connect to Polaris, you create an External Catalog using the rest catalog type. Below is an example of how to configure it:
sql
CREATE EXTERNAL CATALOG polaris_iceberg
PROPERTIES
(
"type" = "iceberg",
"iceberg.catalog.type" = "rest",
"iceberg.catalog.uri" = "https://<polaris-endpoint>/api/catalog",
"iceberg.catalog.warehouse" = "your_warehouse_name",
"iceberg.catalog.security" = "oauth2",
"iceberg.catalog.oauth2.credential" = "<client_id>:<client_secret>",
"iceberg.catalog.oauth2.scope" = "PRINCIPAL_ROLE:ALL",
-- For S3 storage backend
"aws.s3.region" = "us-west-2",
"aws.s3.access_key" = "your_access_key",
"aws.s3.secret_key" = "your_secret_key"
);
2. Writing Data (Sinking)
Once the catalog is created, you can write data directly into the Iceberg tables managed by Polaris:
* INSERT INTO: Appends data to an existing table.
* INSERT OVERWRITE: Replaces data in the table or specific partitions.
* CREATE TABLE AS SELECT (CTAS): Creates a new table in the Polaris catalog and populates it with data.
Example:
sql
INSERT INTO polaris_iceberg.db_name.table_name
SELECT * FROM default_catalog.local_db.local_table;
Key Considerations:
* Version Requirements: Data writing to Iceberg requires StarRocks v3.1 or later.
* File Formats: Currently, StarRocks supports sinking (writing) data to Iceberg tables in Parquet format.
* Shared-Nothing vs. Shared-Data: Both architectures support this feature. In a shared-nothing deployment, the BE nodes handle the parallel write operations directly to the underlying object storage (like S3, GCS, or Azure Blob) while updating the metadata via the Polaris REST API.
* Privileges: Ensure the principal provided in the oauth2.credential has the necessary permissions in Polaris to manage and write to the warehouse.
References
• data_source/catalog/iceberg/DML.md
• data_source/feature-support-data-lake-analytics.md
• quick_start/iceberg.md
• data_source/catalog/iceberg/iceberg_catalog.md
• sql-reference/sql-statements/loading_unloading/INSERT.md
• data_source/file_external_table.mdKalyan Kumar
03/26/2026, 9:50 AMRocky
03/26/2026, 9:50 AMproperties
arrow_flight_port = 9408
# Add JVM opens for Arrow memory management
JAVA_OPTS="-D--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED"
In `be.conf`:
properties
arrow_flight_port = 9419
Note: Restart FE and BE nodes after applying these changes.
2. Configure Spark with the Flight Connector
Since the standard JDBC driver for Spark does not natively handle Arrow Flight's columnar stream for "zero-copy" benefits, you should use the Spark-Flight-Connector.
* Repository: qwshen/spark-flight-connector
* Dependency: Include the connector JAR in your Spark classpath.
Spark Configuration (Submit/Shell):
You must provide the same JVM add-opens flags to the Spark driver and executors to allow Arrow to access off-heap memory directly:
bash
--conf "spark.driver.extraJavaOptions=--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED" \
--conf "spark.executor.extraJavaOptions=--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED"
3. Read Data in Spark
Use the flight format in your Spark code. This will fetch data as Arrow batches, which are then mapped directly to Spark's internal columnar representation (InternalRow/ColumnarBatch).
Example Code (Scala):
scala
val df = spark.read
.format("flight")
.option("flight.host", "FE_HOST")
.option("flight.port", "9408")
.option("flight.user", "your_username")
.option("flight.password", "your_password")
.option("flight.sql", "SELECT * FROM your_catalog.your_db.your_table")
.load()
// Now you can write to Parquet or process further
df.write.parquet("path/to/output")
Why this is "True Zero-Copy" for Columnar Data:
1. Direct Mapping: StarRocks' internal execution engine uses a columnar "Block" structure. With Flight SQL, these blocks are converted to Apache Arrow format (also columnar) with minimal overhead.
2. No Row-Pivot: Traditional JDBC requires StarRocks to convert columns to rows, send them over the wire, and then Spark must convert those rows back into columns for its own processing or for writing to Parquet. Flight SQL keeps the data in columns the entire way.
3. Parallelism: If your Spark executors can reach the StarRocks BE nodes directly, the connector can utilize parallel streams to pull data chunks from multiple BEs simultaneously.
Network Considerations (Proxy Mode)
If your Spark cluster cannot directly access StarRocks BE nodes (e.g., in a restricted Kubernetes environment), StarRocks can proxy the data through the FE:
sql
-- Run this in StarRocks to route all Flight data through FE
SET GLOBAL arrow_flight_proxy_enabled = true;
Note: Proxying through FE incurs a small performance overhead (approx. 10%) compared to direct BE access but maintains the columnar format benefits.
References
• unloading/arrow_flight.mdKalyan Kumar
03/30/2026, 6:02 AMRocky
03/30/2026, 6:02 AMdefault_catalog) use a proprietary high-performance storage format (Segment V2). To have them "governed" by Iceberg-native tools (like Polaris, AWS Glue, or Apache Ranger), the data or the interface must be represented in the Iceberg format.
Here are the primary ways to achieve this:
1. Sinking Native Tables to Iceberg (Data Move/Sync)
Starting from StarRocks v3.1, you can create and write to Iceberg tables directly from StarRocks.
* How it works: You create an External Catalog (e.g., using Glue, Hive Metastore, or a REST catalog like Polaris). You then create an Iceberg table within that catalog and use an INSERT INTO or INSERT OVERWRITE statement to sink data from your StarRocks native table into the Iceberg table.
* Result: The data is stored in Parquet/ORC on your object store (S3/HDFS) with Iceberg metadata, making it fully visible and governable by any Iceberg-compatible tool.
2. Asynchronous Materialized Views (Lakehouse Architecture)
A more automated way is to use Asynchronous Materialized Views.
* Unified Flow: You can define a Materialized View that reads from your StarRocks native tables but sinks the results into an external Iceberg catalog.
* Benefit: This allows you to keep your "hot" data in StarRocks native tables for maximum performance while automatically "exposing" an aggregated or processed version of that data to the Data Lake/Iceberg ecosystem for broad governance and cross-engine access.
3. Iceberg Views (StarRocks v3.5+)
Starting from v3.5, StarRocks supports creating Iceberg Views in an external catalog.
* How it works: You can execute CREATE VIEW targeting an Iceberg catalog. If the underlying data is already in Iceberg format, this allows you to manage the logic/governance at the view level within the Iceberg metadata layer.
4. Governance via REST Catalogs (e.g., Apache Polaris)
StarRocks supports the Iceberg REST Catalog (v3.3+).
* If you use a centralized governance tool like Apache Polaris as your Iceberg REST server, you can create a StarRocks External Catalog pointing to it.
* Any Iceberg table StarRocks creates or writes to in this catalog is immediately governed by the RBAC and policies defined in Polaris.
Summary
* Direct exposure: Native tables are not Iceberg-formatted by default.
* Integrated exposure: Use StarRocks to sink or materialize data into an Iceberg Catalog. Once the data is in the Iceberg format (managed by a catalog like Glue or Polaris), it is fully governed by the Iceberg ecosystem.
If you are looking to build a "Lakehouse" where StarRocks acts as the compute engine while Iceberg provides the storage and governance layer, the best path is to use External Iceberg Catalogs for your primary storage and Materialized Views to bridge the gap between native performance and lakehouse governance.
References
• using_starrocks/async_mv/Materialized_view.md
• using_starrocks/async_mv/use_cases/create_partitioned_materialized_view.md
• using_starrocks/async_mv/use_cases/data_lake_query_acceleration_with_materialized_views.md
• data_source/feature-support-data-lake-analytics.md
• sql-reference/sql-statements/materialized_view/CREATE_MATERIALIZED_VIEW.mdKalyan Kumar
03/30/2026, 6:33 AMRocky
03/30/2026, 6:33 AMsql
CREATE EXTERNAL CATALOG polaris_catalog
PROPERTIES (
"type" = "iceberg",
"iceberg.catalog.type" = "rest",
"iceberg.catalog.uri" = "http://<polaris-host>:8181/api/catalog",
"iceberg.catalog.warehouse" = "<your_polaris_warehouse_name>",
"iceberg.catalog.security" = "oauth2",
"iceberg.catalog.oauth2.credential" = "<client_id>:<client_secret>",
"iceberg.catalog.oauth2.scope" = "PRINCIPAL_ROLE:ALL"
);
Key Configuration Parameters:
* type: Must be set to iceberg.
* iceberg.catalog.type: Must be set to rest to communicate with the Polaris REST API.
* iceberg.catalog.uri: The API endpoint for your Polaris instance (usually ends in /api/catalog).
* iceberg.catalog.warehouse: The specific warehouse name configured in Polaris.
* iceberg.catalog.security: Set to oauth2 for Polaris authentication.
* iceberg.catalog.oauth2.credential: Your Polaris client ID and client secret formatted as <client_id>:<client_secret>.
* iceberg.catalog.oauth2.scope: (Optional) Typically set to PRINCIPAL_ROLE:ALL to grant the session the necessary roles defined in Polaris.
Using the Catalog
Once the catalog is created, you can interact with it just like any other catalog in StarRocks:
1. View Databases:
sql
SHOW DATABASES FROM polaris_catalog;
2. Query Tables:
sql
SELECT * FROM polaris_catalog.your_db.your_table LIMIT 10;
3. Create Tables (if Polaris is configured for write access):
sql
CREATE TABLE polaris_catalog.your_db.new_table (
id INT,
name STRING
);
Why use Polaris with StarRocks?
By using Polaris as the catalog, StarRocks honors the centralized governance and access control policies defined in Polaris. This allows you to manage data security and metadata in one place while using StarRocks for high-performance analytics.
References
• data_source/catalog/iceberg/iceberg_catalog.md
• data_source/catalog/iceberg/iceberg_rest_s3.md
• data_source/catalog/iceberg/iceberg_rest_security.mdKalyan Kumar
03/30/2026, 6:36 AMRocky
03/30/2026, 6:36 AMsql
CREATE EXTERNAL CATALOG polaris_catalog
PROPERTIES (
"type" = "iceberg",
"iceberg.catalog.type" = "rest",
"iceberg.catalog.uri" = "http://<polaris-host>:8181/api/catalog",
"iceberg.catalog.warehouse" = "your_warehouse_name",
"iceberg.catalog.security" = "oauth2",
"iceberg.catalog.oauth2.credential" = "your_client_id:your_client_secret",
"iceberg.catalog.oauth2.scope" = "PRINCIPAL_ROLE:ALL"
);
2. Create the target table in Polaris via StarRocks:
sql
CREATE TABLE polaris_catalog.your_db.governed_table (
id BIGINT,
data STRING,
updated_at DATETIME
) ENGINE=iceberg;
3. Sync the data: Use a scheduled INSERT INTO ... SELECT or a StarRocks Materialized View to automatically propagate changes from your native PK table to the Polaris-governed Iceberg table.
sql
INSERT INTO polaris_catalog.your_db.governed_table
SELECT * FROM default_catalog.local_db.native_pk_table;
2. Unified Governance (External Catalog)
If you want Polaris to be the "source of truth" for metadata, you can define your tables directly as Iceberg tables within StarRocks using the Polaris catalog. While StarRocks PK tables offer the best performance for frequent updates (UPSERTs), StarRocks 3.x+ allows you to perform UPDATE and DELETE operations on Iceberg tables directly through the REST catalog if the table is configured correctly (using V2 row-level deletes).
Why this works:
* StarRocks acts as the high-performance compute engine that can both read from and write to Polaris.
* Apache Polaris acts as the central catalog, allowing other tools (like Spark, Trino, or Flink) to see the data StarRocks has written into the Iceberg format.
Note on PK Tables specifically:
StarRocks native Primary Key tables are highly optimized for sub-second UPSERTs. If your governance requirement is purely for audit/compliance/sharing, syncing to Iceberg (Polaris) is the best route. If you need Polaris to govern the live production table, you should consider using StarRocks to manage an Iceberg table directly, keeping in mind that Iceberg's update performance is different from native PK tables.
References
• data_source/catalog/iceberg/iceberg_catalog.md