Когда я вставляю ряды с миллисекундными временными метками в контейнер временных рядов, и запрос, используя диапазон, один из рядов заканчивается, даже если он явно в пределах времени. Пример Java: < /p>
Код: Выделить всё
import java.sql.Timestamp;
import java.util.*;
public class MillisGapDemo {
public static void main(String[] args) throws Exception {
Properties p = new Properties();
p.setProperty("clusterName", "defaultCluster");
p.setProperty("notificationAddress", "239.0.0.1");
p.setProperty("notificationPort", "31999");
p.setProperty("user", "admin");
p.setProperty("password", "admin");
GridStore gs = GridStoreFactory.getInstance().getGridStore(p);
ContainerInfo info = new ContainerInfo();
info.setType(ContainerType.TIME_SERIES);
info.setRowKeyAssigned(true);
info.setColumnInfoList(List.of(
new ColumnInfo("ts", GSType.TIMESTAMP),
new ColumnInfo("value", GSType.DOUBLE)
));
TimeSeries ts = gs.putTimeSeries("millis_test", info, true);
ts.put(Arrays.asList(
createRow(ts, Timestamp.valueOf("2023-01-01 10:00:00.500"), 25.0),
createRow(ts, Timestamp.valueOf("2023-01-01 10:00:01.000"), 26.0)
));
RowSet rs = ts.query(
"SELECT * WHERE ts >= TIMESTAMP('2023-01-01 10:00:00') AND ts < TIMESTAMP('2023-01-01 10:00:02')"
).fetch();
System.out.println("Rows returned: " + rs.size());
}
private static Row createRow(TimeSeries ts, Timestamp t, double v) {
Row r = ts.createRow();
r.setTimestamp(0, t);
r.setDouble(1, v);
return r;
}
}
< /code>
Ожидается: оба ряда (10: 00: 00.500 и 10: 00: 01.000) должны быть возвращены
Actual: только ряд 10: 00: 01.000 - ряд 10: 00: 00.500 пропущенная < /p>
. операторы сравнения (>=
Код: Выделить всё
timeZone
Вопросы:
Griddb раунд или усечение временных лампов внутри микросекунды? /> Можно ли это быть клиентом и сервером мирового несоответствия?>
Подробнее здесь: https://stackoverflow.com/questions/796 ... s-java-api