-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix insert/load with timestamp of Long.MIN_VALUE and LONG.MAX_VALUE #14491
base: master
Are you sure you want to change the base?
Conversation
# Conflicts: # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
@@ -336,7 +344,7 @@ public void insertByObjAndNotInferTypeTest() { | |||
expected.add(TSDataType.TEXT.name()); | |||
|
|||
Set<String> actual = new HashSet<>(); | |||
SessionDataSet dataSet = session.executeQueryStatement("show timeseries root.**"); | |||
SessionDataSet dataSet = session.executeQueryStatement("show timeseries root.sg1.**"); |
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 avoids conflicts with other tests.
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.
Self-reviewed
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 previousTime also needs to be modified. This value is used in checkPreviousTimeAndUpdate to check the order of timestamps. Perhaps we can add a boolean to determine whether to set initial values.
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.
Fixed
These classes also need to be modified:
|
@@ -158,8 +161,10 @@ public void execute() throws IOException { | |||
flushChunkWriter(); | |||
} | |||
fileWriter.checkMetadataSizeAndMayFlush(); | |||
targetResource.updateStartTime(device, minStartTimestamp); | |||
targetResource.updateEndTime(device, maxEndTimestamp); | |||
if (minStartTimestampSet) { |
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 use minStartTimestamp <= minEndTimestamp
to instead these booleans?
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.
You mean still let the initial value of minStartTimestamp
be Long.MAX
and maxEndTimestamp
be Long.MIN
?
It is possible, but I think it may be more important not to leave the impression that Long.MAX and Long.MIN are treated as special timestamps and keep the consistency with other places.
@@ -140,8 +142,12 @@ protected int calculatingMaxOverlapFileNumInSubCompactionTask(List<TsFileResourc | |||
long maxEndTimeOfCurrentDevice = Long.MIN_VALUE; | |||
int overlapFileNumOfCurrentDevice = 0; | |||
for (ArrayDeviceTimeIndex resource : resourcesContainsCurrentDevice) { | |||
long deviceStartTimeInCurrentFile = resource.getStartTime(device); | |||
long deviceEndTimeInCurrentFile = resource.getEndTime(device); | |||
if (resource.definitelyNotContains(device)) { |
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 check should have been done in line135
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.
Removed
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
No description provided.