Implementation:Risingwavelabs Risingwave JniCatalogWrapper LoadTable
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Data_Lake, Metadata_Management, Iceberg, JNI |
| Last Updated | 2026-02-09 07:00 GMT |
Overview
Concrete tool for performing Iceberg catalog operations via JNI bridge provided by the RisingWave Java connector node.
Description
JniCatalogWrapper provides JNI-accessible methods for Iceberg catalog operations. It wraps an Apache Iceberg Catalog instance (loaded via CatalogUtil.loadCatalog()) and delegates operations through CatalogHandlers (the Iceberg REST compatibility layer). All requests and responses are serialized as JSON strings for JNI transport.
Usage
This is called from the Rust engine via JNI when the Iceberg sink needs to create, load, update, or drop tables in the catalog.
Code Reference
Source Location
- Repository: risingwave
- File: java/connector-node/risingwave-sink-iceberg/src/main/java/com/risingwave/connector/catalog/JniCatalogWrapper.java
- Lines: L51-219
Signature
public class JniCatalogWrapper {
public String loadTable(String tableIdentifier) throws Exception;
public String createTable(String namespaceStr, String createTableRequest) throws Exception;
public String updateTable(String updateTableRequest) throws Exception;
public boolean tableExists(String tableIdentifier);
public boolean dropTable(String tableIdentifier);
public void createNamespace(String namespaceStr);
public boolean namespaceExists(String namespaceStr);
public String listNamespaces() throws Exception;
public String listTables(String namespaceStr) throws Exception;
public void close() throws Exception;
public static JniCatalogWrapper create(
String name,
String klassName,
String[] props
);
}
Import
import com.risingwave.connector.catalog.JniCatalogWrapper;
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| name | String | Yes (for create) | Catalog name |
| klassName | String | Yes (for create) | Delegated catalog class (e.g., org.apache.iceberg.hadoop.HadoopCatalog) |
| props | String[] | Yes (for create) | Key-value pairs for catalog configuration |
| tableIdentifier | String | Yes (for loadTable) | Table identifier in format 'namespace.table' |
| createTableRequest | String (JSON) | Yes (for createTable) | Serialized CreateTableRequest |
| updateTableRequest | String (JSON) | Yes (for updateTable) | Serialized UpdateTableRequest |
Outputs
| Name | Type | Description |
|---|---|---|
| loadTable return | String (JSON) | Serialized LoadTableResponse with table metadata and location |
| createTable return | String (JSON) | Serialized LoadTableResponse for newly created table |
| updateTable return | String (JSON) | Serialized LoadTableResponse after update |
| tableExists return | boolean | Whether the table exists in the catalog |
Usage Examples
Create Catalog and Load Table (Internal Java)
// Create a Hadoop-based catalog
JniCatalogWrapper catalog = JniCatalogWrapper.create(
"demo",
"org.apache.iceberg.hadoop.HadoopCatalog",
new String[]{
"warehouse", "s3://hummock001/iceberg-data",
"io-impl", "org.apache.iceberg.aws.s3.S3FileIO"
}
);
// Load a table
String tableJson = catalog.loadTable("demo_db.demo_table");
// Returns JSON with table schema, partition spec, location, etc.
// Check existence
boolean exists = catalog.tableExists("demo_db.demo_table");
// Clean up
catalog.close();
Related Pages
Implements Principle
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment