Open
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.
This logic is already there at line 223
| @@ -84,7 +87,11 @@ public Schema getSchema(ResultSetMetaData metadata, int index) throws SQLExcepti | |||
| return Schema.of(Schema.LogicalType.TIMESTAMP_MICROS); | |||
| case Types.TIMESTAMP: | |||
There was a problem hiding this comment.
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.
you have to call it in oracle source class to make it work
| + "backward compatibility.") | ||
| @Macro | ||
| @Nullable | ||
| private boolean treatAsOldTimestamp = false; |
There was a problem hiding this comment.
make it object type otherwise it will be shown as mandatory
| } | ||
|
|
||
| public boolean shouldTreatAsOldTimestamp() { | ||
| return treatAsOldTimestamp; |
There was a problem hiding this comment.
do like this
return Boolean.TRUE.equals(treatAsOldTimestamp);
| return connection; | ||
| } | ||
|
|
||
| public Boolean shouldTreatAsOldTimestamp() { |
| } | ||
|
|
||
| public OracleSourceSchemaReader(String sessionID) { | ||
| public OracleSourceSchemaReader(String sessionID, Boolean treatAsOldTimestamp) { |
| 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.
add a comment mentioning why are we doing it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.