e-mhui opened a new pull request, #7561:
URL: https://github.com/apache/inlong/pull/7561

   ### Prepare a Pull Request
   
   Fix Oracle CDC reads timestamp type record error
   
   - Fixes #7559 
   
   ### Motivation
   
   Oracle CDC reads timestamp type record error. Because Oracle CDC has been 
shaded, the schema will have the prefix 
'org.apache.inlong.sort.cdc.oracle.shaded' added, so we need to use 
`schemaName.contains()` to determine the Schema type.
   
   <img width="1247" alt="52273cb-2691-452b-8b55-66f82c0a33fd" 
src="https://user-images.githubusercontent.com/111486498/224255963-ad9bbc0c-d8d7-49a6-b9f0-54b862dc7927.png";>
   
   
   ### Modifications
   
    Use `schemaName.contains()` to determine the Schema type.
   
   ```java
                       String schemaName = schema.name();
                       if (schemaName.contains(Timestamp.SCHEMA_NAME)) {
                           return TimestampData.fromEpochMillis((Long) dbzObj);
                       } else if 
(schemaName.contains(MicroTimestamp.SCHEMA_NAME)) {
                           long micro = (long) dbzObj;
                           return TimestampData.fromEpochMillis(
                                   micro / 1000, (int) (micro % 1000 * 1000));
                       } else if 
(schemaName.contains(NanoTimestamp.SCHEMA_NAME)) {
                           long nano = (long) dbzObj;
                           return TimestampData.fromEpochMillis(
                                   nano / 1000_000, (int) (nano % 1000_000));
                       }
   ```


-- 
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