...
User Facing Name | Type | Description | Constraints |
---|---|---|---|
Label | String | Label for UI | |
Host | String | Mysql host | Required (defaults to localhost on UI) |
Port | Number | Specific port where mysql running on | Optional (default 3306) |
Database | String | Database name to connect | Required |
Username | String | DB username | Required |
Password | String | User password | Required |
Connection Arguments | Keyvalue | A list of arbitrary string tag/value pairs as connection arguments, list of properties https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-configuration-properties.html | |
Database Command | String | Database command to run | Valid SQL query |
Use SSL | Select | Turns on SSL encryption. The connection will fail if SSL is not available. | |
Keystore URL | String | URL to the client certificate KeyStore (if not specified, use defaults). Must be accessible at the same location on host where CDAP Master is running and all hosts on which at least one HDFS, MapReduce, or YARN daemon role is running. | |
Keystore password | String | Password for the client certificates KeyStore. | |
Truststore URL | String | URL to the trusted root certificate KeyStore (if not specified, use defaults). Must be accessible at the same location on host where CDAP Master is running and all hosts on which at least one HDFS, MapReduce, or YARN daemon role is running. | |
Truststore password | String | Password for the trusted root certificates KeyStore | |
Use compression protocol | Boolean | Use zlib compression when communicating with the server. Select this option for WAN connections. | |
SQL_MODE | String | Override the default SQL_MODE session variable used by the server. | |
Use ANSI quotes to quote identifiers | Boolean | Treats " as an identifier quote character and not as a string quote character. |
Data Types Mapping
MySQL Data Type | CDAP Schema Data Type | Support | Comment |
---|---|---|---|
BIT | Schema.Type.BOOLEAN | + | |
TINYINT | Schema.Type.INT | + | |
BOOL, BOOLEAN | Schema.Type.BOOLEAN | + | |
SMALLINT | Schema.Type.INT | + | |
MEDIUMINT | Schema.Type.INT | + | |
INT,INTEGER | Schema.Type.INT | + | |
BIGINT | Schema.Type.LONG | + | |
FLOAT | Schema.Type.FLOAT | + | |
DOUBLE | Schema.Type.DOUBLE | + | |
DECIMAL | Schema.LogicalType.DECIMAL | + | |
DATE | Schema.Type.DATE | + | |
DATETIME | Schema.LogicalType.TIMESTAMP_MICROS | + | |
TIMESTAMP | Schema.LogicalType.TIMESTAMP_MICROS | + | |
TIME | Schema.LogicalType.TIME_MICROS | + | |
YEAR | Schema.Type.DATE | + | |
CHAR | Schema.Type.STRING | + | |
VARCHAR | Schema.Type.STRING | + | |
BINARY | Schema.Type.BYTES | + | |
VARBINARY | Schema.Type.BYTES | + | |
TINYBLOB | Schema.Type.BYTES | + | |
TINYTEXT | Schema.Type.STRING | + | |
BLOB | Schema.Type.BYTES | + | |
TEXT | Schema.Type.STRING | + | |
MEDIUMBLOB | Schema.Type.BYTES | + | |
MEDIUMTEXT | Schema.Type.STRING | + | |
LONGBLOB | Schema.Type.BYTES | + | |
LONGTEXT | Schema.Type.STRING | + | |
ENUM | Schema.Type.STRING |
* | No such type in java.sql.Types, mapping to String by default | ||
SET | Schema.Type.STRING | + |
Approach
Create a module mysql-plugin inĀ database-plugins project, reuse existing database-plugins code if possible. Add MySQL-specific properties to configuration, add support for MySQL-specific datatypes. Update UI widgets JSON definitions.
...