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 @@ -339,6 +339,18 @@ public void test() throws Exception {
// empty result
compareQueryResults(
session, "select * from view3 limit 1", "select * from table1 limit 0", true);

// not exists
compareQueryResults(
session,
"select count(*) from view1 where battery = 'b'",
"select count(*) from table1 where battery = 'b'",
false);
compareQueryResults(
session,
"select * from (select time, battery as device1 from view1 where battery = 'b1') as t1 full outer join (select time, battery as device2 from view2 where battery = 'b') as t2 using(time)",
"select * from (select time, battery as device1 from table1 where battery = 'b1') as t1 full outer join (select time, battery as device2 from table1 where battery = 'b') as t2 using(time)",
true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ private List<PlanNode> constructDeviceTableScanByRegionReplicaSet(
@Override
public List<PlanNode> visitTreeDeviceViewScan(TreeDeviceViewScanNode node, PlanContext context) {
DataPartition dataPartition = analysis.getDataPartitionInfo();
if (dataPartition == null) {
if (dataPartition == null || node.getTreeDBName() == null) {
node.setRegionReplicaSet(NOT_ASSIGNED);
return Collections.singletonList(node);
}
Expand Down Expand Up @@ -1025,6 +1025,10 @@ public List<PlanNode> visitAggregationTableScan(
node instanceof AggregationTreeDeviceViewScanNode
? ((AggregationTreeDeviceViewScanNode) node).getTreeDBName()
: node.getQualifiedObjectName().getDatabaseName();
if (dbName == null) {
node.setRegionReplicaSet(NOT_ASSIGNED);
return Collections.singletonList(node);
}
DataPartition dataPartition = analysis.getDataPartitionInfo();
boolean needSplit = false;
List<List<TRegionReplicaSet>> regionReplicaSetsList = new ArrayList<>();
Expand Down
Loading