[
https://issues.apache.org/jira/browse/FLINK-31820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
xingyuan cheng updated FLINK-31820:
-----------------------------------
Description:
At present, apache/flink-connector-jdbc does not support sub-database and table
sub-database. Now three commonly used databases Mysql, Postgres and Oracle
support sub-database and sub-table
Taking oracle as an example, users only need to configure the following format
to use
{code:java}
create table oracle_source (
EMPLOYEE_ID BIGINT,
START_DATE TIMESTAMP,
END_DATE TIMESTAMP,
JOB_ID VARCHAR,
DEPARTMENT_ID VARCHAR
) with (
type = 'oracle',
url =
'jdbc:oracle:thin:@//localhost:3306/order_([0-9]{1,}),jdbc:oracle:thin:@//localhost:3306/order_([0-9]{1,})',
userName = 'userName',
password = 'password',
dbName = 'hr',
table-name = 'order_([0-9]{1,})',
timeField = 'START_DATE',
startTime = '2007-1-1 00:00:00'
); {code}
In the above code, the dbName attribute corresponds to the schema-name
attribute in oracle or postgres, and the mysql database needs to manually
specify the dbName
At the same time, I am also developing the CDAS whole database synchronization
syntax for the company, and the data source supports sub-database and table as
part of it. Add unit tests. For now, please keep this PR in draft status.
was:
At present, apache/flink-connector-jdbc does not support sub-database and table
sub-database. Now three commonly used databases Mysql, Postgres and Oracle
support sub-database and sub-table
Taking oracle as an example, users only need to configure the following format
to use
{code:java}
create table oracle_source (
EMPLOYEE_ID BIGINT,
START_DATE TIMESTAMP,
END_DATE TIMESTAMP,
JOB_ID VARCHAR,
DEPARTMENT_ID VARCHAR
) with (
type = 'oracle',
url =
'jdbc:oracle:thin:@//localhost:3306/order_([0-9]{1,}),jdbc:oracle:thin:@//localhost:3306/order_([0-9]{1,})',
userName = 'userName',
password = 'password',
dbName = 'hr',
tableName = 'job_history',
timeField = 'START_DATE',
startTime = '2007-1-1 00:00:00'
); {code}
In the above code, the dbName attribute corresponds to the schema-name
attribute in oracle or postgres, and the mysql database needs to manually
specify the dbName
At the same time, I am also developing the CDAS whole database synchronization
syntax for the company, and the data source supports sub-database and table as
part of it. Add unit tests. For now, please keep this PR in draft status.
> Support data source sub-database and sub-table
> ----------------------------------------------
>
> Key: FLINK-31820
> URL: https://issues.apache.org/jira/browse/FLINK-31820
> Project: Flink
> Issue Type: Improvement
> Components: Connectors / JDBC
> Reporter: xingyuan cheng
> Priority: Major
> Labels: pull-request-available
>
> At present, apache/flink-connector-jdbc does not support sub-database and
> table sub-database. Now three commonly used databases Mysql, Postgres and
> Oracle support sub-database and sub-table
>
> Taking oracle as an example, users only need to configure the following
> format to use
>
> {code:java}
> create table oracle_source (
> EMPLOYEE_ID BIGINT,
> START_DATE TIMESTAMP,
> END_DATE TIMESTAMP,
> JOB_ID VARCHAR,
> DEPARTMENT_ID VARCHAR
> ) with (
> type = 'oracle',
> url =
> 'jdbc:oracle:thin:@//localhost:3306/order_([0-9]{1,}),jdbc:oracle:thin:@//localhost:3306/order_([0-9]{1,})',
> userName = 'userName',
> password = 'password',
> dbName = 'hr',
> table-name = 'order_([0-9]{1,})',
> timeField = 'START_DATE',
> startTime = '2007-1-1 00:00:00'
> ); {code}
> In the above code, the dbName attribute corresponds to the schema-name
> attribute in oracle or postgres, and the mysql database needs to manually
> specify the dbName
>
> At the same time, I am also developing the CDAS whole database
> synchronization syntax for the company, and the data source supports
> sub-database and table as part of it. Add unit tests. For now, please keep
> this PR in draft status.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)