-
Notifications
You must be signed in to change notification settings - Fork 50
fix(QTDI-1686):[TCK Framework]: allow pass logical type when studio dynamic schema case #1062
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: master
Are you sure you want to change the base?
Conversation
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.
Use withLogicalType insted of withProp.
.withEntry(factory.newEntryBuilder() | ||
.withName("time1") | ||
.withType(Type.DATETIME) | ||
.withProp(SchemaProperty.LOGICAL_TYPE, SchemaProperty.LogicalType.TIME.key()) |
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.
Don't use withProp(...) to set logical type, please use withLogicalType:
factory.newEntryBuilder()
.withName("date")
.withType(Type.DATETIME)
.withLogicalType(LogicalType.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.
2 more comments
@@ -502,6 +514,9 @@ private Entry toEntry(final String name, final Schema.Type type, final String or | |||
props.put(PATTERN, pattern); | |||
} | |||
props.put(STUDIO_TYPE, studioType); | |||
if (logicalType != null) { |
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 use withLogicalType in the "return factory..." don' put it in a temporary map taht will be used in withProps(...)
return factory
.newEntryBuilder()
.withName(name)
.withRawName(originalName)
.withNullable(isNullable)
.withType(type)
.withComment(comment)
.withDefaultValue(defaultValue)
.withProps(props)
.withLogicalType(SchemaProperty.LogicalType.valueOf(logicalType))
.build();
@@ -306,7 +304,14 @@ private DynamicMetadataWrapper generateMetadata(final Entry entry) { | |||
|
|||
switch (studioType) { | |||
case StudioTypes.DATE: | |||
metadata.getDynamicMetadata().setLogicalType("timestamp-millis"); | |||
final String logicalType = entry.getProps().get(LOGICAL_TYPE); |
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 use entry.getLogicalType()
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.
LGTM
Requirements
Why this PR is needed?
https://qlik-dev.atlassian.net/browse/QTDI-1686
What does this PR adds (design/code thoughts)?
https://qlik-dev.atlassian.net/browse/QTDI-1686