Skip to content
Merged
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 @@ -27,6 +27,7 @@
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runners.Parameterized;
Expand Down Expand Up @@ -236,6 +237,52 @@ public void testShowTimeSeries() {
}
}

@Test
@Ignore
public void testCountTimeSeriesWithTimeConditionIncludesView() {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("CREATE DATABASE root.view_count");
statement.execute(
"CREATE TIMESERIES root.view_count.src.s1 WITH DATATYPE = INT32, ENCODING = PLAIN");
statement.execute(
"CREATE TIMESERIES root.view_count.src.s2 WITH DATATYPE = INT32, ENCODING = PLAIN");
statement.execute("CREATE VIEW root.view_count.dst.v1 AS SELECT s1 FROM root.view_count.src");

checkResultSet(
statement,
"count timeseries root.view_count.**",
new HashSet<>(Collections.singletonList("3,")));

statement.execute("insert into root.view_count.src(timestamp,s1) values(1,1)");

checkResultSet(
statement,
"count timeseries root.view_count.** where time>0",
new HashSet<>(Collections.singletonList("2,")));
checkResultSet(
statement,
"show timeseries root.view_count.** where time>0",
new HashSet<>(
Arrays.asList(
"root.view_count.src.s1,null,root.view_count,INT32,PLAIN,LZ4,null,null,null,null,BASE,",
"root.view_count.dst.v1,null,root.view_count,INT32,null,null,null,null,null,null,VIEW,")));
checkResultSet(
statement,
"count timeseries root.view_count.dst.** where time>0",
new HashSet<>(Collections.singletonList("1,")));
checkResultSet(
statement,
"show timeseries root.view_count.dst.** where time>0",
new HashSet<>(
Collections.singletonList(
"root.view_count.dst.v1,null,root.view_count,INT32,null,null,null,null,null,null,VIEW,")));
} catch (Exception e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}

@Test
public void testShowDevices() {
try (Connection connection = EnvFactory.getEnv().getConnection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ public TCheckTimeSeriesExistenceResp checkTimeSeriesExistence(
for (final PartialPath pattern : filteredPatternTree.getAllPathPatterns()) {
ISchemaSource<ITimeSeriesSchemaInfo> schemaSource =
SchemaSourceFactory.getTimeSeriesSchemaCountSource(
pattern, false, null, null, SchemaConstant.ALL_MATCH_SCOPE);
pattern, false, null, null, SchemaConstant.ALL_MATCH_SCOPE, true, true);
try (final ISchemaReader<ITimeSeriesSchemaInfo> schemaReader =
schemaSource.getSchemaReader(schemaRegion)) {
if (schemaReader.hasNext()) {
Expand Down Expand Up @@ -1996,7 +1996,9 @@ public TDeviceViewResp detectTreeDeviceViewFieldType(final TDeviceViewReq req) {
// Does not support logical view currently
SchemaFilterFactory.createViewTypeFilter(ViewType.BASE),
null,
SchemaConstant.ALL_MATCH_SCOPE);
SchemaConstant.ALL_MATCH_SCOPE,
true,
true);
try (final ISchemaReader<ITimeSeriesSchemaInfo> schemaReader =
schemaSource.getSchemaReader(schemaRegion)) {
final Map<String, Byte> updateMap = resp.getDeviewViewFieldTypeMap();
Expand Down
Loading
Loading