|
25 | 25 | import org.apache.iotdb.common.rpc.thrift.TSStatus; |
26 | 26 | import org.apache.iotdb.common.rpc.thrift.TShowConfigurationResp; |
27 | 27 | import org.apache.iotdb.common.rpc.thrift.TShowConfigurationTemplateResp; |
28 | | -import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot; |
29 | 28 | import org.apache.iotdb.commons.audit.AuditEventType; |
30 | 29 | import org.apache.iotdb.commons.audit.AuditLogFields; |
31 | 30 | import org.apache.iotdb.commons.audit.AuditLogOperation; |
|
34 | 33 | import org.apache.iotdb.commons.conf.CommonDescriptor; |
35 | 34 | import org.apache.iotdb.commons.conf.ConfigurationFileUtils; |
36 | 35 | import org.apache.iotdb.commons.conf.IoTDBConstant; |
37 | | -import org.apache.iotdb.commons.consensus.DataRegionId; |
38 | 36 | import org.apache.iotdb.commons.exception.IllegalPathException; |
39 | 37 | import org.apache.iotdb.commons.exception.IoTDBException; |
40 | 38 | import org.apache.iotdb.commons.partition.DataPartition; |
|
44 | 42 | import org.apache.iotdb.commons.path.MeasurementPath; |
45 | 43 | import org.apache.iotdb.commons.path.NonAlignedFullPath; |
46 | 44 | import org.apache.iotdb.commons.path.PartialPath; |
47 | | -import org.apache.iotdb.commons.schema.column.ColumnHeader; |
48 | 45 | import org.apache.iotdb.commons.utils.PathUtils; |
49 | | -import org.apache.iotdb.commons.utils.TimePartitionUtils; |
50 | 46 | import org.apache.iotdb.db.audit.DNAuditLogger; |
51 | 47 | import org.apache.iotdb.db.auth.AuthorityChecker; |
52 | 48 | import org.apache.iotdb.db.conf.IoTDBConfig; |
|
122 | 118 | import org.apache.iotdb.db.schemaengine.SchemaEngine; |
123 | 119 | import org.apache.iotdb.db.schemaengine.schemaregion.ISchemaRegion; |
124 | 120 | import org.apache.iotdb.db.schemaengine.template.TemplateQueryType; |
125 | | -import org.apache.iotdb.db.storageengine.StorageEngine; |
126 | 121 | import org.apache.iotdb.db.storageengine.dataregion.DataRegion; |
127 | 122 | import org.apache.iotdb.db.storageengine.dataregion.read.QueryDataSource; |
128 | 123 | import org.apache.iotdb.db.storageengine.rescon.quotas.DataNodeThrottleQuotaManager; |
|
163 | 158 | import org.apache.iotdb.service.rpc.thrift.TSFetchResultsReq; |
164 | 159 | import org.apache.iotdb.service.rpc.thrift.TSFetchResultsResp; |
165 | 160 | import org.apache.iotdb.service.rpc.thrift.TSGetTimeZoneResp; |
166 | | -import org.apache.iotdb.service.rpc.thrift.TSGroupByQueryIntervalReq; |
167 | 161 | import org.apache.iotdb.service.rpc.thrift.TSInsertRecordReq; |
168 | 162 | import org.apache.iotdb.service.rpc.thrift.TSInsertRecordsOfOneDeviceReq; |
169 | 163 | import org.apache.iotdb.service.rpc.thrift.TSInsertRecordsReq; |
|
188 | 182 | import org.apache.iotdb.service.rpc.thrift.TSyncTransportMetaInfo; |
189 | 183 |
|
190 | 184 | import io.airlift.units.Duration; |
191 | | -import org.apache.commons.lang3.StringUtils; |
192 | 185 | import org.apache.thrift.TException; |
193 | 186 | import org.apache.tsfile.block.column.Column; |
194 | 187 | import org.apache.tsfile.common.conf.TSFileConfig; |
@@ -1299,72 +1292,6 @@ public TSExecuteStatementResp executeAggregationQueryV2(TSAggregationQueryReq re |
1299 | 1292 | return executeAggregationQueryInternal(req, SELECT_RESULT); |
1300 | 1293 | } |
1301 | 1294 |
|
1302 | | - @Override |
1303 | | - public TSExecuteStatementResp executeGroupByQueryIntervalQuery(TSGroupByQueryIntervalReq req) |
1304 | | - throws TException { |
1305 | | - |
1306 | | - try { |
1307 | | - IClientSession clientSession = SESSION_MANAGER.getCurrSessionAndUpdateIdleTime(); |
1308 | | - |
1309 | | - String database = req.getDatabase(); |
1310 | | - if (StringUtils.isEmpty(database)) { |
1311 | | - String[] splits = req.getDevice().split("\\."); |
1312 | | - database = String.format("%s.%s", splits[0], splits[1]); |
1313 | | - } |
1314 | | - IDeviceID deviceId = Factory.DEFAULT_FACTORY.create(req.getDevice()); |
1315 | | - String measurementId = req.getMeasurement(); |
1316 | | - TSDataType dataType = TSDataType.getTsDataType((byte) req.getDataType()); |
1317 | | - |
1318 | | - // only one database, one device, one time interval |
1319 | | - Map<String, List<DataPartitionQueryParam>> sgNameToQueryParamsMap = new HashMap<>(); |
1320 | | - TTimePartitionSlot timePartitionSlot = |
1321 | | - TimePartitionUtils.getTimePartitionSlot(req.getStartTime()); |
1322 | | - DataPartitionQueryParam queryParam = |
1323 | | - new DataPartitionQueryParam( |
1324 | | - deviceId, Collections.singletonList(timePartitionSlot), false, false); |
1325 | | - sgNameToQueryParamsMap.put(database, Collections.singletonList(queryParam)); |
1326 | | - DataPartition dataPartition = partitionFetcher.getDataPartition(sgNameToQueryParamsMap); |
1327 | | - List<DataRegion> dataRegionList = new ArrayList<>(); |
1328 | | - List<TRegionReplicaSet> replicaSets = |
1329 | | - dataPartition.getDataRegionReplicaSetWithTimeFilter(deviceId, null); |
1330 | | - for (TRegionReplicaSet region : replicaSets) { |
1331 | | - dataRegionList.add( |
1332 | | - StorageEngine.getInstance() |
1333 | | - .getDataRegion(new DataRegionId(region.getRegionId().getId()))); |
1334 | | - } |
1335 | | - |
1336 | | - List<TsBlock> blockResult = |
1337 | | - executeGroupByQueryInternal( |
1338 | | - SESSION_MANAGER.getSessionInfo(clientSession), |
1339 | | - deviceId, |
1340 | | - measurementId, |
1341 | | - dataType, |
1342 | | - req.isAligned, |
1343 | | - req.getStartTime(), |
1344 | | - req.getEndTime(), |
1345 | | - req.getInterval(), |
1346 | | - req.getAggregationType(), |
1347 | | - dataRegionList); |
1348 | | - |
1349 | | - String outputColumnName = req.getAggregationType().name(); |
1350 | | - List<ColumnHeader> columnHeaders = |
1351 | | - Collections.singletonList(new ColumnHeader(outputColumnName, dataType)); |
1352 | | - DatasetHeader header = new DatasetHeader(columnHeaders, false); |
1353 | | - header.setTreeColumnToTsBlockIndexMap(Collections.singletonList(outputColumnName)); |
1354 | | - |
1355 | | - TSExecuteStatementResp resp = createResponse(header, 1); |
1356 | | - TSQueryDataSet queryDataSet = convertTsBlockByFetchSize(blockResult); |
1357 | | - resp.setQueryDataSet(queryDataSet); |
1358 | | - |
1359 | | - return resp; |
1360 | | - } catch (Exception e) { |
1361 | | - return RpcUtils.getTSExecuteStatementResp( |
1362 | | - onQueryException(e, "\"" + req + "\". " + OperationType.EXECUTE_AGG_QUERY)); |
1363 | | - } finally { |
1364 | | - SESSION_MANAGER.updateIdleTime(); |
1365 | | - } |
1366 | | - } |
1367 | | - |
1368 | 1295 | @Override |
1369 | 1296 | public TSFetchResultsResp fetchResultsV2(TSFetchResultsReq req) { |
1370 | 1297 | long startTime = System.nanoTime(); |
|
0 commit comments