OceanBase catalog
Introduction
Apache Gravitino provides the ability to manage OceanBase metadata.
Gravitino saves some system information in schema and table comment, like (From Gravitino, DO NOT EDIT: gravitino.v1.uid1078334182909406185)
, please don't change or remove this message.
Catalog
Catalog capabilities
- Gravitino catalog corresponds to the OceanBase instance.
- Supports metadata management of OceanBase (4.x).
- Supports DDL operation for OceanBase databases and tables.
- Supports table index.
- Supports column default value and auto-increment.
Catalog properties
You can pass to a OceanBase 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
If you use a JDBC catalog, you must provide jdbc-url
, jdbc-driver
, jdbc-user
and jdbc-password
to catalog properties.
Besides the common catalog properties, the OceanBase 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:2881 or jdbc:oceanbase://localhost:2881 | (none) | Yes | 0.7.0-incubating |
jdbc-driver | The driver of the JDBC connection. For example, com.mysql.jdbc.Driver or com.mysql.cj.jdbc.Driver or com.oceanbase.jdbc.Driver . | (none) | Yes | 0.7.0-incubating |
jdbc-user | The JDBC user name. | (none) | Yes | 0.7.0-incubating |
jdbc-password | The JDBC password. | (none) | Yes | 0.7.0-incubating |
jdbc.pool.min-size | The minimum number of connections in the pool. 2 by default. | 2 | No | 0.7.0-incubating |
jdbc.pool.max-size | The maximum number of connections in the pool. 10 by default. | 10 | No | 0.7.0-incubating |
Before using the OceanBase Catalog, you must download the corresponding JDBC driver to the catalogs/jdbc-oceanbase/libs
directory.
Gravitino doesn't package the JDBC driver for OceanBase due to licensing issues.
Catalog operations
Refer to Manage Relational Metadata Using Gravitino for more details.
Schema
Schema capabilities
- Gravitino's schema concept corresponds to the OceanBase database.
- Supports creating schema, but does not support setting comment.
- Supports dropping schema.
- Supports cascade dropping schema.
Schema properties
- Doesn't support any schema property settings.
Schema operations
Refer to Manage Relational Metadata Using Gravitino for more details.
Table
Table capabilities
- Gravitino's table concept corresponds to the OceanBase table.
- Supports DDL operation for OceanBase tables.
- Supports index.
- Supports column default value and auto-increment..
Table properties
- Doesn't support table properties.
Table column types
Gravitino Type | OceanBase Type |
---|---|
Byte | Tinyint |
Byte(false) | Tinyint Unsigned |
Short | Smallint |
Short(false) | Smallint Unsigned |
Integer | Int |
Integer(false) | Int Unsigned |
Long | Bigint |
Long(false) | Bigint Unsigned |
Float | Float |
Double | Double |
String | Text |
Date | Date |
Time | Time |
Timestamp | Timestamp |
Decimal | Decimal |
VarChar | VarChar |
FixedChar | FixedChar |
Binary | Binary |
OceanBase doesn't support Gravitino Boolean
Fixed
Struct
List
Map
Timestamp_tz
IntervalDay
IntervalYear
Union
UUID
type.
Meanwhile, the data types other than listed above are mapped to Gravitino External Type that represents an unresolvable data type since 0.6.0-incubating.