Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private static void queryData() {

query =
new Query(
"select count(temperature),first(temperature),last(temperature),max(temperature),mean(temperature),median(temperature),min(temperature),mode(temperature),spread(temperature),stddev(temperature),sum(temperature) from student where ((workshop=\"A1\" and production=\"B1\" and cell =\"C1\" ) or temperature< 15 )",
"select count(temperature),first(temperature),last(temperature),max(temperature),mean(temperature),median(temperature),min(temperature),mode(temperature),spread(temperature),stddev(temperature),sum(temperature) from factory where ((workshop=\"A1\" and production=\"B1\" and cell =\"C1\" ) or temperature< 15 )",
database);
result = influxDB.query(query);
System.out.println("query2 result:" + result.getResults().get(0).getSeries().get(0).toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.utility.DockerImageName;

import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class IoTDBInfluxDBIT {

Expand Down Expand Up @@ -164,8 +168,9 @@ public void testCommonQueryColumn() {
QueryResult.Series series = result.getResults().get(0).getSeries().get(0);

String[] retArray = new String[] {"time", "name", "sex", "province", "country", "score", "tel"};
Set<String> columnNames = new HashSet<>(Arrays.asList(retArray));
for (int i = 0; i < series.getColumns().size(); i++) {
assertEquals(retArray[i], series.getColumns().get(i));
assertTrue(columnNames.contains(series.getColumns().get(i)));
}
}

Expand Down
Loading