-
Notifications
You must be signed in to change notification settings - Fork 990
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
[core] Support timestamp field type in record level expire #4417
Conversation
&& field.type() instanceof BigIntType) | ||
|| (timeFieldType == CoreOptions.TimeFieldType.MILLIS_LONG | ||
&& field.type() instanceof BigIntType))) { | ||
if (!isValidateFieldType(timeFieldType, field)) { | ||
throw new IllegalArgumentException( | ||
String.format( | ||
"The record level time field type should be one of SECONDS_INT,SECONDS_LONG or MILLIS_LONG, " |
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.
The record level time field type should be one of SECONDS_INT, SECONDS_LONG, MILLIS_LONG or TIMESTAMP, but time field type is %s, field type is %s.
|
||
private static boolean isValidateFieldType( | ||
CoreOptions.TimeFieldType timeFieldType, DataField field) { | ||
return ((timeFieldType == CoreOptions.TimeFieldType.SECONDS_INT |
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.
DataType dataType = field.type();
long millis = System.currentTimeMillis(); | ||
Timestamp timestamp1 = Timestamp.fromEpochMillis(millis - 60 * 1000); | ||
Timestamp timestamp2 = Timestamp.fromEpochMillis(millis); | ||
Timestamp timestamp3 = Timestamp.fromEpochMillis(millis + 60 * 1000); |
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 ut to test LocalZonedTimestampType?
} | ||
|
||
@Test | ||
public void test() throws Exception { |
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.
test what?
Please add Purpose of this pr. |
addressed, thanks for your review @wwj6591812 |
@@ -1351,7 +1351,7 @@ public class CoreOptions implements Serializable { | |||
.enumType(TimeFieldType.class) | |||
.defaultValue(TimeFieldType.SECONDS_INT) |
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.
Can we just set this to AUTO
? If the field is timestamp, we don't need to set this option.
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.
AUTO
maybe cannot adapt to all types, just added detailed log.
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.
+1
Purpose
Record level expiration supports timestamp type and timestamp_ltz type.
Tests
API and Format
Documentation