-
Notifications
You must be signed in to change notification settings - Fork 11
"[PLUGIN-1901] Time datatype support for actual value type" #99
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
"[PLUGIN-1901] Time datatype support for actual value type" #99
Conversation
ec75721 to
3dc91fb
Compare
3dc91fb to
d1b43ad
Compare
|
Can you please add more details(What and Why, testing details) in the description. Also e2e tests are failing for this PR |
Added, working on e2e |
| columns.add(new ServiceNowColumn(field.getName(), field.getType())); | ||
| } else if (valueType.equals(SourceValueType.SHOW_ACTUAL_VALUE) && | ||
| "glide_time".equalsIgnoreCase(field.getInternalType())) { | ||
| columns.add(new ServiceNowColumn(field.getName(), "datetime")); |
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 should be glide_date_time
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
| case "glide_date": | ||
| return Schema.of(Schema.LogicalType.DATE); | ||
| case "glide_date_time": | ||
| case "datetime": |
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 can be omitted. As, we can use glide_date_time
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
d1b43ad to
f6ce966
Compare
| !Objects.equals(field.getType(), field.getInternalType())) { | ||
| columns.add(new ServiceNowColumn(field.getName(), field.getType())); | ||
| } else if (valueType.equals(SourceValueType.SHOW_ACTUAL_VALUE) && | ||
| "glide_time".equalsIgnoreCase(field.getInternalType())) { |
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.
Please move "glide_time" to constants
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
| columns.add(new ServiceNowColumn(field.getName(), field.getType())); | ||
| } else if (valueType.equals(SourceValueType.SHOW_ACTUAL_VALUE) && | ||
| "glide_time".equalsIgnoreCase(field.getInternalType())) { | ||
| columns.add(new ServiceNowColumn(field.getName(), "glide_date_time")); |
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.
same as above
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
f6ce966 to
cdcd55d
Compare
| private static final String FIELD_CREATED_ON = "sys_created_on"; | ||
| private static final String FIELD_UPDATED_ON = "sys_updated_on"; | ||
| private static final String OAUTH_URL_TEMPLATE = "%s/oauth_token.do"; | ||
| private static final String GLIDE_TIME = "glide_time"; |
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.
[nit]: Adding a DATA_TYPE as prefix or suffix would make it more readable
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
cdcd55d to
b636e77
Compare
Issue: for fields of type
glide_timein ServiceNow, when the value is retrieved using theactualvalue type, it is returned in aglide_datetimeformat. This causes a parsing failure, as the expected format forglide_timeis not maintained. However, when using thedisplayvalue type, the value is correctly returned asglide_time.Root Cause: ServiceNow automatically prefixes a default date to
glide_timevalues when accessed via theactualvalue type, converting it todatetimeformat.Fix: implemented explicit handling to map
glide_timefields todatetimewhen using theactualvalue type.JIRA Ticket: https://cdap.atlassian.net/browse/PLUGIN-1901