e-mhui opened a new issue, #7858:
URL: https://github.com/apache/inlong/issues/7858

   ### What happened
   
   If the lowercase database name(` 'database-name' = 'orcl'`) is set in 
FlinkSQL, Oracle will upload two different metrics because during the snapshot 
, Oracle uses the db name from FlinkSQL, but during the stream, it uses the db 
name from the database. Therefore, two dbname metrics are generated on one 
table.
   
   ```sql
   CREATE TABLE products (
       db_name STRING METADATA FROM 'database_name' VIRTUAL,
       schema_name STRING METADATA FROM 'schema_name' VIRTUAL, 
       table_name STRING METADATA  FROM 'table_name' VIRTUAL,
       operation_ts TIMESTAMP_LTZ(3) METADATA FROM 'op_ts' VIRTUAL,
       ID INT NOT NULL,
       NAME STRING,
       DESCRIPTION STRING,
       WEIGHT DECIMAL(10, 3),
       PRIMARY KEY(id) NOT ENFORCED
   ) WITH (
       'connector' = 'oracle-cdc',
       'hostname' = 'localhost',
       'port' = '1521',
       'username' = 'flinkuser',
       'password' = 'flinkpw',
       'database-name' = 'orcl',
       'schema-name' = 'inventory',
       'table-name' = 'products',
       'debezium.log.mining.strategy' = 'online_catalog',
       'debezium.log.mining.continuous.mine' = 'true'
   );
   ```
   
   
   <img width="577" alt="image" 
src="https://user-images.githubusercontent.com/111486498/231988870-b063bb21-9331-4b18-89c8-2db1995b9112.png";>
   
   
   ### What you expected to happen
   
   Oracle CDC reports the same db metric for the same table.
   
   ### How to reproduce
   
   Set the lowercase database name(` 'database-name' = 'orcl'`)  in FlinkSQL, 
such as:
   
   ```sql
   CREATE TABLE products (
       db_name STRING METADATA FROM 'database_name' VIRTUAL,
       schema_name STRING METADATA FROM 'schema_name' VIRTUAL, 
       table_name STRING METADATA  FROM 'table_name' VIRTUAL,
       operation_ts TIMESTAMP_LTZ(3) METADATA FROM 'op_ts' VIRTUAL,
       ID INT NOT NULL,
       NAME STRING,
       DESCRIPTION STRING,
       WEIGHT DECIMAL(10, 3),
       PRIMARY KEY(id) NOT ENFORCED
   ) WITH (
       'connector' = 'oracle-cdc',
       'hostname' = 'localhost',
       'port' = '1521',
       'username' = 'flinkuser',
       'password' = 'flinkpw',
       'database-name' = 'orcl',
       'schema-name' = 'inventory',
       'table-name' = 'products',
       'debezium.log.mining.strategy' = 'online_catalog',
       'debezium.log.mining.continuous.mine' = 'true'
   );
   ```
   
   ### Environment
   
   _No response_
   
   ### InLong version
   
   master
   
   ### InLong Component
   
   InLong Sort
   
   ### Are you willing to submit PR?
   
   - [X] Yes, I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to