Fix Cassandra DAO

This commit is contained in:
Andrii Shvaika 2022-09-16 11:55:48 +03:00
parent 4bc66473db
commit 89c715cd18
5 changed files with 11 additions and 24 deletions

View File

@ -16,7 +16,6 @@
package org.thingsboard.server.service.telemetry.cmd.v2;
import lombok.Data;
import org.thingsboard.server.common.data.kv.Aggregation;
import java.util.List;

View File

@ -62,16 +62,4 @@ public class EntityDataCmd extends DataCmd {
return historyCmd != null || latestCmd != null || tsCmd != null || aggHistoryCmd != null || aggTsCmd != null;
}
@JsonIgnore
public boolean hasRegularCmds() {
return historyCmd != null || latestCmd != null || tsCmd != null;
}
@JsonIgnore
public boolean hasAggCmds() {
return aggHistoryCmd != null || aggTsCmd != null;
}
}

View File

@ -27,7 +27,6 @@ import org.thingsboard.server.common.data.kv.TsKvEntry;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @author Andrew Shvayka

View File

@ -631,14 +631,14 @@ public class ModelConstants {
protected static final String[] NONE_AGGREGATION_COLUMNS = new String[]{LONG_VALUE_COLUMN, DOUBLE_VALUE_COLUMN, BOOLEAN_VALUE_COLUMN, STRING_VALUE_COLUMN, JSON_VALUE_COLUMN, KEY_COLUMN, TS_COLUMN};
protected static final String[] COUNT_AGGREGATION_COLUMNS = new String[]{count(LONG_VALUE_COLUMN), count(DOUBLE_VALUE_COLUMN), count(BOOLEAN_VALUE_COLUMN), count(STRING_VALUE_COLUMN), count(JSON_VALUE_COLUMN)};
protected static final String[] COUNT_AGGREGATION_COLUMNS = new String[]{count(LONG_VALUE_COLUMN), count(DOUBLE_VALUE_COLUMN), count(BOOLEAN_VALUE_COLUMN), count(STRING_VALUE_COLUMN), count(JSON_VALUE_COLUMN), max(TS_COLUMN)};
protected static final String[] MIN_AGGREGATION_COLUMNS =
ArrayUtils.addAll(COUNT_AGGREGATION_COLUMNS, new String[]{min(LONG_VALUE_COLUMN), min(DOUBLE_VALUE_COLUMN), min(BOOLEAN_VALUE_COLUMN), min(STRING_VALUE_COLUMN), min(JSON_VALUE_COLUMN), max(TS_COLUMN)});
ArrayUtils.addAll(COUNT_AGGREGATION_COLUMNS, new String[]{min(LONG_VALUE_COLUMN), min(DOUBLE_VALUE_COLUMN), min(BOOLEAN_VALUE_COLUMN), min(STRING_VALUE_COLUMN), min(JSON_VALUE_COLUMN)});
protected static final String[] MAX_AGGREGATION_COLUMNS =
ArrayUtils.addAll(COUNT_AGGREGATION_COLUMNS, new String[]{max(LONG_VALUE_COLUMN), max(DOUBLE_VALUE_COLUMN), max(BOOLEAN_VALUE_COLUMN), max(STRING_VALUE_COLUMN), max(JSON_VALUE_COLUMN), max(TS_COLUMN)});
ArrayUtils.addAll(COUNT_AGGREGATION_COLUMNS, new String[]{max(LONG_VALUE_COLUMN), max(DOUBLE_VALUE_COLUMN), max(BOOLEAN_VALUE_COLUMN), max(STRING_VALUE_COLUMN), max(JSON_VALUE_COLUMN)});
protected static final String[] SUM_AGGREGATION_COLUMNS =
ArrayUtils.addAll(COUNT_AGGREGATION_COLUMNS, new String[]{sum(LONG_VALUE_COLUMN), sum(DOUBLE_VALUE_COLUMN), max(TS_COLUMN)});
ArrayUtils.addAll(COUNT_AGGREGATION_COLUMNS, new String[]{sum(LONG_VALUE_COLUMN), sum(DOUBLE_VALUE_COLUMN)});
protected static final String[] AVG_AGGREGATION_COLUMNS = SUM_AGGREGATION_COLUMNS;
public static String min(String s) {

View File

@ -49,12 +49,13 @@ public class AggregatePartitionsFunction implements com.google.common.util.concu
private static final int BOOL_CNT_POS = 2;
private static final int STR_CNT_POS = 3;
private static final int JSON_CNT_POS = 4;
private static final int LONG_POS = 5;
private static final int DOUBLE_POS = 6;
private static final int BOOL_POS = 7;
private static final int STR_POS = 8;
private static final int JSON_POS = 9;
private static final int MAX_TS_POS = 10;
private static final int MAX_TS_POS = 5;
private static final int LONG_POS = 6;
private static final int DOUBLE_POS = 7;
private static final int BOOL_POS = 8;
private static final int STR_POS = 9;
private static final int JSON_POS = 10;
private final Aggregation aggregation;
private final String key;