[influxdb] Fix query for InfluxDB2 (#14542)

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K 2023-03-05 16:04:51 +01:00 committed by GitHub
parent c7f7dbdc07
commit 6da85a4757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,6 +165,9 @@ public class InfluxDB2RepositoryImpl implements InfluxDBRepository {
private Stream<InfluxRow> mapRawResultToHistoric(FluxTable rawRow) {
return rawRow.getRecords().stream().map(r -> {
String itemName = (String) r.getValueByKey(InfluxDBConstants.TAG_ITEM_NAME);
if (itemName == null) {
itemName = r.getMeasurement();
}
Object value = r.getValueByKey(COLUMN_VALUE_NAME_V2);
Instant time = (Instant) r.getValueByKey(COLUMN_TIME_NAME_V2);
return new InfluxRow(time, itemName, value);