StarRocks Catalog
Introduction
Apache Gravitino provides the ability to manage StarRocks metadata through JDBC connection.
Gravitino saves some system information in table comments, like
(From Gravitino, DO NOT EDIT: gravitino.v1.uid1078334182909406185), do not change or remove this message.
Catalog
Catalog Capabilities
- Gravitino catalog corresponds to the StarRocks instance.
- Supports metadata management of StarRocks (3.3.x).
- Supports column default value.
Catalog Properties
Pass to a StarRocks data source any property that isn't defined by Gravitino by adding
gravitino.bypass. prefix as a catalog property. For example, catalog property
gravitino.bypass.maxWaitMillis will pass maxWaitMillis to the data source property.
Check the relevant data source configuration in data source properties for more details.
Besides the common catalog properties, the StarRocks catalog has the following properties:
| Configuration item | Description | Default value | Required | Since Version |
|---|---|---|---|---|
jdbc-url | JDBC URL for connecting to the database. For example, jdbc:mysql://localhost:9030 | (none) | Yes | 1.0.0 |
jdbc-driver | The driver of the JDBC connection. For example, com.mysql.jdbc.Driver. | (none) | Yes | 1.0.0 |
jdbc-user | The JDBC user name. | (none) | Yes | 1.0.0 |
jdbc-password | The JDBC password. | (none) | Yes | 1.0.0 |
jdbc.pool.min-size | The minimum number of connections in the pool. 2 by default. | 2 | No | 1.0.0 |
jdbc.pool.max-size | The maximum number of connections in the pool. 10 by default. | 10 | No | 1.0.0 |
jdbc.pool.max-wait-ms | The maximum Duration that the pool will wait for a connection to be returned. 30000 by default. | 30000 | No | 1.1.0 |
Before using the StarRocks Catalog, you must download the corresponding JDBC driver to the catalogs/jdbc-starrocks/libs directory.
Gravitino doesn't package the JDBC driver for StarRocks due to licensing issues.
Driver Version Compatibility
The StarRocks catalog includes driver version compatibility checks for datetime precision calculation:
- MySQL Connector/J versions >= 8.0.16: Full support for datetime precision calculation
- MySQL Connector/J versions < 8.0.16: Limited support - datetime precision calculation returns
nullwith a warning log
This limitation affects the following datetime types:
DATETIME(p)- datetime precision
When using an unsupported driver version, the system will:
- Continue to work normally with default precision (0)
- Log a warning message indicating the driver version limitation
- Return
nullfor precision calculations to avoid incorrect results
Example warning log:
WARN: MySQL driver version mysql-connector-java-8.0.11 is below 8.0.16,
columnSize may not be accurate for precision calculation.
Returning null for DATETIME type precision. Driver version: mysql-connector-java-8.0.11
Recommended driver versions:
mysql-connector-java-8.0.16or higher
Catalog Operations
Refer to Manage Relational Metadata Using Gravitino for more details.
Sensitive catalog properties such as jdbc-user and jdbc-password are hidden from the load catalog response since Gravitino 1.3.0. Use the credential vending API to retrieve them at runtime.
Schema
Schema Capabilities
- Gravitino's schema concept corresponds to the StarRocks database.
- Supports creating schema.
- Supports dropping schema.
Schema Properties
As StarRocks can't get thr properties after set, So now we do not support set Schema properties.