-
Notifications
You must be signed in to change notification settings - Fork 0
Added treatAsOldTimeStamp field #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
717070c
59f1c1b
fa0fe82
757daf5
4c94f9b
6d27959
444d0fa
209683c
681c7f4
f70a62b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,13 +66,16 @@ public class OracleSourceSchemaReader extends CommonSchemaReader { | |
|
|
||
| private final String sessionID; | ||
|
|
||
| private final boolean treatAsOldTimestamp; | ||
|
|
||
| public OracleSourceSchemaReader() { | ||
| this(null); | ||
| this(null, false); | ||
| } | ||
|
|
||
| public OracleSourceSchemaReader(String sessionID) { | ||
| public OracleSourceSchemaReader(String sessionID, boolean treatAsOldTimestamp) { | ||
| super(); | ||
| this.sessionID = sessionID; | ||
| this.treatAsOldTimestamp = treatAsOldTimestamp; | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -83,8 +86,17 @@ public Schema getSchema(ResultSetMetaData metadata, int index) throws SQLExcepti | |
| case TIMESTAMP_TZ: | ||
| return Schema.of(Schema.LogicalType.TIMESTAMP_MICROS); | ||
| case Types.TIMESTAMP: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For timestamp it should be return Schema.of(Schema.LogicalType.DATETIME); always. handle both cases separately |
||
| case TIMESTAMP_LTZ: | ||
| return Schema.of(Schema.LogicalType.DATETIME); | ||
| case TIMESTAMP_LTZ: | ||
| // TIMESTAMP_LTZ (Local timezone timestamp) | ||
| // - Legacy behavior used TIMESTAMP_MICROS | ||
| // - New behavior uses DATETIME for accurate semantic representation | ||
| // Use treatAsOldTimestamp flag to ensure backward compatibility | ||
| if (treatAsOldTimestamp) { | ||
| return Schema.of(Schema.LogicalType.TIMESTAMP_MICROS); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add a comment mentioning why are we doing it |
||
| } else { | ||
| return Schema.of(Schema.LogicalType.DATETIME); | ||
| } | ||
| case BINARY_FLOAT: | ||
| return Schema.of(Schema.Type.FLOAT); | ||
| case BINARY_DOUBLE: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have to call it in oracle source class to make it work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!