shaohui hong created FLINK-36776:
------------------------------------
Summary: OracleIncrementalSource does not support partitioned table
Key: FLINK-36776
URL: https://issues.apache.org/jira/browse/FLINK-36776
Project: Flink
Issue Type: Bug
Components: Flink CDC
Affects Versions: 3.0.0
Reporter: shaohui hong
In OracleConnectionUtils.java, a function named listTables gets all table names
from database, and uses a table filter to exclude all tables that are not
configured to be captured. If a partitioned table is created in oracle
database, a record is added to ALL_TABLES view, but the TABLESPACE_NAME of this
record is null, which causes the query to get all tables in the database does
not return this partitioned table, as the where condition of sql that is used
in the query has "TABLESPACE_NAME is not null".
The solution is chaning the queryTableSql defined in OracleConnectionUtils
listTables function from
"SELECT OWNER ,TABLE_NAME,TABLESPACE_NAME FROM ALL_TABLES \n"
+ "WHERE TABLESPACE_NAME IS NOT NULL AND
TABLESPACE_NAME NOT IN ('SYSTEM','SYSAUX') AND NESTED = 'NO' AND TABLE_NAME NOT
IN (SELECT PARENT_TABLE_NAME FROM ALL_NESTED_TABLES)";
to
"SELECT OWNER ,TABLE_NAME,TABLESPACE_NAME FROM ALL_TABLES \n"
+ "WHERE (TABLESPACE_NAME IS NULL OR TABLESPACE_NAME
NOT IN ('SYSTEM','SYSAUX')) AND NESTED = 'NO' AND TABLE_NAME NOT IN (SELECT
PARENT_TABLE_NAME FROM ALL_NESTED_TABLES)";
--
This message was sent by Atlassian Jira
(v8.20.10#820010)