Skip to content

Conversation

@Krish-cloudsufi
Copy link
Owner

No description provided.

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

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:
Copy link

@vikasrathee-cs vikasrathee-cs May 28, 2025

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

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

Copy link
Owner Author

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;

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;

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() {

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

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants