After you create a custom data source type, you can integrate it into Dataphin to prepare for subsequent integration development.
Prerequisites
A custom data source type exists. For more information, see:
Procedure
In the top navigation bar of the Dataphin homepage, choose Management Hub > Datasource Management.
On the Datasource page, click +Create Data Source.
In the Create Data Source page in the Custom Data Source Area, select the customized data source type.
This topic uses a custom data source type named mysql-test as an example. The mysql-test data source is a relational database management system (RDBMS).
On the Create mysql-test Data Source page, configure the connection information.
Parameter
Description
Datasource Name
Enter the data source name. The data source name can contain Chinese characters, uppercase and lowercase letters, digits, underscores (_), and hyphens (-). It can be up to 64 characters in length.
Datasource Code
After you configure the data source code, you can directly access Dataphin data source tables in Flink_SQL nodes or using the Dataphin Java Database Connectivity (JDBC) client. Use the format
DatasourceCode.TableNameorDatasourceCode.Schema.TableNamefor quick access. To automatically switch data sources based on the task execution environment, use the variable format${DatasourceCode}.tableor${DatasourceCode}.schema.table. For more information, see Development methods for Dataphin data source tables and .ImportantThe data source code cannot be modified after it is configured.
You can preview data on the object details page in the asset directory and asset inventory only after the data source code is configured.
In Flink SQL, only MySQL, Hologres, MaxCompute, Oracle, StarRocks, Hive, and SelectDB data sources are supported.
Data Source Description (Optional)
Enter a brief description of the data source. The string can be up to 128 characters in length.
Data Source Configuration
Configure the data source:
If the development mode is Basic mode, select Production Data Source.
If the development mode is Dev-Prod mode, you can configure the data source using the following methods:
Click Production + Development Data Source to configure data sources for both production and development environments.
Click Production Data Source to configure the production data source. After you create the production data source, click Development Data Source to configure the development environment data source.
NoteThe system supports configuring Production Data Source and Development Data Source as the same data source or as different data sources.
Tag (optional)
Select the tag categorization to which the data source belongs.
Connection Address
Enter the connection URL for the database. For example,
jdbc:mysql://host:port/dbname.Username, Password
Enter the username and password to log on to the database.
Dbname
Specifies the database or catalog from which to get metadata about available tables.
Schema
Specifies the schema from which to get metadata about available tables.
Select Default Resource Group, which is used to run tasks related to the current data source, including database SQL, offline database migration, and data preview.
Perform a Test Connection or directly click OK to save and complete the creation of the custom data source.
If you click Test Connection, the system tests the connection to Dataphin. If you click OK, the system automatically tests the connection for all selected clusters. The data source is created even if the connection tests fail.