未验证 提交 7eeae49c 编写于 作者: B Boris 提交者: GitHub

Reduce unnecessary initialization (#1682)

上级 4cedb4e0
......@@ -25,7 +25,6 @@ import java.util.List;
import java.util.Map;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.StorageEngineException;
import org.apache.iotdb.db.exception.metadata.IllegalPathException;
import org.apache.iotdb.db.exception.query.QueryProcessException;
import org.apache.iotdb.db.metadata.PartialPath;
import org.apache.iotdb.db.qp.physical.crud.GroupByTimeFillPlan;
......@@ -92,13 +91,9 @@ public class GroupByFillDataSet extends QueryDataSet {
Arrays.fill(lastTimeArray, Long.MAX_VALUE);
for (int i = 0; i < paths.size(); i++) {
TimeValuePair lastTimeValuePair;
try {
lastTimeValuePair = LastQueryExecutor.calculateLastPairForOneSeriesLocally(
new PartialPath(paths.get(i).getFullPath()), dataTypes.get(i), context,
groupByFillPlan.getAllMeasurementsInDevice(paths.get(i).getDevice()));
} catch (IllegalPathException e) {
throw new QueryProcessException(e.getMessage());
}
lastTimeValuePair = LastQueryExecutor.calculateLastPairForOneSeriesLocally(
(PartialPath) paths.get(i), dataTypes.get(i), context,
groupByFillPlan.getAllMeasurementsInDevice(paths.get(i).getDevice()));
if (lastTimeValuePair.getValue() != null) {
lastTimeArray[i] = lastTimeValuePair.getTimestamp();
}
......
......@@ -30,7 +30,6 @@ import java.util.Set;
import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
import org.apache.iotdb.db.engine.storagegroup.TsFileResource;
import org.apache.iotdb.db.exception.StorageEngineException;
import org.apache.iotdb.db.exception.metadata.IllegalPathException;
import org.apache.iotdb.db.exception.metadata.MetadataException;
import org.apache.iotdb.db.exception.query.QueryProcessException;
import org.apache.iotdb.db.metadata.PartialPath;
......@@ -80,13 +79,9 @@ public class LastQueryExecutor {
for (int i = 0; i < selectedSeries.size(); i++) {
TimeValuePair lastTimeValuePair = null;
try {
lastTimeValuePair = calculateLastPairForOneSeries(
new PartialPath(selectedSeries.get(i).getFullPath()), dataTypes.get(i), context,
lastQueryPlan.getAllMeasurementsInDevice(selectedSeries.get(i).getDevice()));
} catch (IllegalPathException e) {
throw new QueryProcessException(e.getMessage());
}
lastTimeValuePair = calculateLastPairForOneSeries(
selectedSeries.get(i), dataTypes.get(i), context,
lastQueryPlan.getAllMeasurementsInDevice(selectedSeries.get(i).getDevice()));
if (lastTimeValuePair.getValue() != null) {
RowRecord resultRecord = new RowRecord(lastTimeValuePair.getTimestamp());
Field pathField = new Field(TSDataType.TEXT);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册