Skip to content

Commit bd8aabc

Browse files
committed
Don't turn a integral field into floating point one during migration.
1 parent 3464847 commit bd8aabc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

infrastructure/src/main/java/scala/bench/DataMigrator.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.influxdb.dto.Query;
77
import org.influxdb.dto.QueryResult;
88

9-
import java.io.IOException;
109
import java.time.Instant;
1110
import java.util.*;
1211
import java.util.concurrent.TimeUnit;
@@ -54,7 +53,13 @@ public static void main(String[] args) {
5453
LinkedHashMap<String, Object> newFieldsMap = new LinkedHashMap<>();
5554
assert (newFieldNames.size() == newValues.size());
5655
for (int i = 0; i < newFieldNames.size(); i++) {
57-
newFieldsMap.put(newFieldNames.get(i), newValues.get(i));
56+
String fieldName = newFieldNames.get(i);
57+
boolean isLong = fieldName.equals("sampleCount");
58+
if (isLong) {
59+
newFieldsMap.put(fieldName, ((Number) newValues.get(i)).longValue());
60+
} else {
61+
newFieldsMap.put(fieldName, newValues.get(i));
62+
}
5863
}
5964
builder.fields(newFieldsMap);
6065
Instant parse = Instant.parse(time);

0 commit comments

Comments
 (0)