-
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?
Conversation
| @Override | ||
| protected void validateField(FailureCollector collector, | ||
| Schema.Field field, Schema actualFieldSchema, Schema expectedFieldSchema) { | ||
| // For handling backward compatibility with pipelines built prior to plugin version change. |
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.
This logic is already there at line 223
| switch (sqlType) { | ||
| 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 comment
The 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
| } | ||
|
|
||
| public OracleSourceSchemaReader(String sessionID) { | ||
| public OracleSourceSchemaReader(String sessionID, boolean treatAsOldTimestamp) { |
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!
| + "backward compatibility.") | ||
| @Macro | ||
| @Nullable | ||
| private boolean treatAsOldTimestamp = false; |
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.
make it object type otherwise it will be shown as mandatory
| } | ||
|
|
||
| public boolean shouldTreatAsOldTimestamp() { | ||
| return treatAsOldTimestamp; |
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.
do like this
return Boolean.TRUE.equals(treatAsOldTimestamp);
| return connection; | ||
| } | ||
|
|
||
| public Boolean shouldTreatAsOldTimestamp() { |
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.
make return type as primitive
| } | ||
|
|
||
| public OracleSourceSchemaReader(String sessionID) { | ||
| public OracleSourceSchemaReader(String sessionID, Boolean treatAsOldTimestamp) { |
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.
make it primitive
| return Schema.of(Schema.LogicalType.DATETIME); | ||
| case TIMESTAMP_LTZ: | ||
| if (treatAsOldTimestamp) { | ||
| return Schema.of(Schema.LogicalType.TIMESTAMP_MICROS); |
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.
add a comment mentioning why are we doing it
No description provided.