Skip to main content
Version: 0.3.1

MySQL catalog

Introduction

Gravitino provides the ability to manage MySQL metadata.

Catalog

Catalog capabilities

  • Supports metadata management of MySQL (5.6, 5.7, 8.0).
  • Supports DDL operation for MySQL databases and tables.
  • Doesn't support table index operations.
  • Doesn't support setting certain column properties, such as default value and check constraints.

Catalog properties

Any property that isn't defined by Gravitino can pass to MySQL data source by adding gravitino.bypass prefix as a catalog property. For example, catalog property gravitino.bypass.maxWaitMillis will pass maxWaitMillis to the data source property. You can check the relevant data source configuration in data source properties

If you use JDBC catalog, you must provide jdbc-url, jdbc-driver, jdbc-user and jdbc-password to catalog properties.

Configuration itemDescriptionDefault valueRequiredSince Version
jdbc-urlJDBC URL for connecting to the database. For example jdbc:mysql://localhost:3306(none)Yes0.3.0
jdbc-driverThe driver of the JDBC connection. For example com.mysql.jdbc.Driver or com.mysql.cj.jdbc.Driver.(none)Yes0.3.0
jdbc-userThe JDBC user name.(none)Yes0.3.0
jdbc-passwordThe JDBC password.(none)Yes0.3.0
jdbc.pool.min-sizeThe minimum number of connections in the pool. 2 by default.2No0.3.0
jdbc.pool.max-sizeThe maximum number of connections in the pool. 10 by default.10No0.3.0
caution

You must download the corresponding JDBC driver to the catalogs/jdbc-mysql/libs directory.

Catalog operations

Please refer to Manage Metadata Using Gravitino for more details.

Schema

Schema capabilities

  • Gravitino schema corresponds to the MySQL database.
  • Supports create schema with comments.
  • Supports drop schema.
  • Doesn't support cascade drop database.

Schema properties

  • Doesn't support any database property settings.

Schema operations

Please refer to Manage Metadata Using Gravitino for more details.

Table

Table capabilities

  • Gravitino table corresponds to the MySQL table.
  • Supports DDL operation for MySQL tables.
  • Doesn't support setting certain column properties, such as default value and check constraints.
  • Doesn't support index definition.
  • Doesn't support table property settings.

Table column types

Gravitino TypeMySQL Type
ByteTinyint
ShortSmallint
IntegerInt
LongBigint
FloatFloat
DoubleDouble
StringText
DateDate
TimeTime
TimestampTimestamp
DecimalDecimal
VarCharVarChar
FixedCharFixedChar
BinaryBinary
info

MySQL doesn't support Gravitino Boolean Fixed Struct List Map Timestamp_tz IntervalDay IntervalYear Union UUID type.

Table properties

  • Doesn't support table properties.

Table operations

Please refer to Manage Metadata Using Gravitino for more details.

Alter table operations

Supports operations:

  • RenameTable
  • UpdateComment
  • AddColumn
  • DeleteColumn
  • RenameColumn
  • UpdateColumnType
  • UpdateColumnPosition
  • UpdateColumnNullability
  • UpdateColumnComment
info

You cannot submit the RenameTable operation at the same time as other operations.

caution

If you update a nullability column to non nullability, there may be compatibility issues.