Creating a SelectDB data source allows Dataphin to read data from or write data to SelectDB.
Background
SelectDB is a data warehouse widely used for real-time reporting, ad-hoc multidimensional analysis, log retrieval and analysis, data federation, and query acceleration. It provides high-performance, easy-to-use data analysis services.
Permissions
Only users with the Super Admin, Data Source Admin, Section Architect, or Project Admin system role, or a custom global role with the Create Data Source permission, can create data sources.
Procedure
-
On the Dataphin homepage, click Admin Center > Data Source Management in the top navigation bar.
-
On the Data Sources page, click + Add Data Source.
-
On the Add Data Source page, in the Big Data Storage section, select SelectDB.
If you have recently used SelectDB, you can also select it in the Recently Used section. Alternatively, you can enter "SelectDB" in the search box to find it.
-
On the Create SelectDB Data Source page, configure the connection parameters for the data source.
-
Configure basic information
Parameter
Description
Data Source Name
Follow these naming conventions:
-
Can contain Chinese characters, uppercase and lowercase letters, digits, underscores (_), and hyphens (-).
-
Cannot exceed 64 characters in length.
Data Source Code
After configuring a Data Source Code, you can reference tables in a Flink SQL task using the
Data Source Code.tableorData Source Code.schema.tableformat. To enable Dataphin to automatically access the data source for the current environment, use the${Data Source Code}.tableor${Data Source Code}.schema.tableformat. For more information, see Develop a Flink SQL task.Important-
The 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 checklist only after the data source code is configured.
-
In Flink SQL, only MySQL, Hologres, MaxCompute, Oracle, StarRocks, Hive, SelectDB, and GaussDB data warehouse service (DWS) data sources are currently supported.
Kernel Version
You can select Cloud Core v3.0.x (based on Apache Doris v2.1.x) or Cloud Core v4.0.x (based on Apache Doris v3.0.x).
Data Source Description
Enter a brief description of the data source, up to 128 characters.
Data Source Configuration
Select the data source configuration to use:
-
If you use separate data sources for production and development, select Production + Development Data Source.
-
If you use a single data source for both, select Production Data Source.
Tags
You can use tags to classify and label data sources. For information about how to create tags, see Manage Data Source Tags.
-
-
Configure connection parameters
If you set Data Source Configuration to Production + Development Data Source, you must configure connection information for both the production and development environments. If you select Production Data Source, you only need to configure parameters for the production environment.
NoteTypically, you should use different data sources for production and development to achieve environment isolation and reduce the impact of the development environment on the production environment. However, Dataphin also supports using the same data source for both, which means the parameter values are identical.
Parameter
Description
JDBC URL
Enter the JDBC URL connection string for SelectDB. The format is
jdbc:mysql://host:port/dbname.Username and Password
Enter the username and password used to connect to the database.
Arrow Flight SQL port (optional)
The port on the SelectDB FE for high-speed, large-scale data synchronization using the Arrow Flight SQL protocol. The default is 8070.
FE node URL
Enter the hostnames and HTTP ports of the SelectDB Front End (FE) nodes. The format is
fe_host:http_port,fe_host:http_port. If you have multiple FE nodes, separate them with commas (,). The default HTTP port for SelectDB is 8030. -
Configure advanced settings
Parameter
Description
connectTimeout
The timeout for database connections, in milliseconds (ms). The default is 900000 ms (15 minutes).
Note-
If you include the connectTimeout parameter in the JDBC URL, the value specified in the URL takes precedence.
-
For data sources created in Dataphin versions earlier than V3.11, the default value for connectTimeout is
-1, which indicates no timeout.
socketTimeout
The timeout for database sockets, in milliseconds (ms). The default is 1800000 ms (30 minutes).
Note-
If you include the socketTimeout parameter in the JDBC URL, the value specified in the URL takes precedence.
-
For data sources created in Dataphin versions earlier than V3.11, the default value for socketTimeout is
-1, which indicates no timeout.
Connection Retries
If a connection attempt times out, Dataphin retries the connection up to the specified number of times. If all retries fail, the connection is considered to have failed.
Note-
The default number of retries is 1. You can set this value to an integer from 0 to 10.
-
The connection retries setting applies by default to batch integration tasks and Global Quality (requires the asset quality module to be enabled). You can also configure the number of retries at the task level for batch integration tasks.
-
-
-
Select a default resource group. This resource group runs tasks related to the data source, such as database SQL execution, batch full-database migration, and data preview.
-
Click Test Connection to verify the connection, or click OK to save and create the data source.
Click Test Connection, and the system will test whether the data source can connect to Dataphin. If you click OK, the system automatically tests the connection for all selected clusters. However, the data source can still be created successfully even if the connection to all selected clusters fails.