diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java index 2cc1a66f8375b..b5edafec160c2 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java @@ -25,13 +25,11 @@ import org.apache.iotdb.common.rpc.thrift.TSStatus; import org.apache.iotdb.common.rpc.thrift.TShowConfigurationResp; import org.apache.iotdb.common.rpc.thrift.TShowConfigurationTemplateResp; -import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot; import org.apache.iotdb.commons.client.exception.ClientManagerException; import org.apache.iotdb.commons.conf.CommonConfig; import org.apache.iotdb.commons.conf.CommonDescriptor; import org.apache.iotdb.commons.conf.ConfigurationFileUtils; import org.apache.iotdb.commons.conf.IoTDBConstant; -import org.apache.iotdb.commons.consensus.DataRegionId; import org.apache.iotdb.commons.exception.IllegalPathException; import org.apache.iotdb.commons.exception.IoTDBException; import org.apache.iotdb.commons.partition.DataPartition; @@ -40,7 +38,6 @@ import org.apache.iotdb.commons.path.MeasurementPath; import org.apache.iotdb.commons.path.PartialPath; import org.apache.iotdb.commons.utils.PathUtils; -import org.apache.iotdb.commons.utils.TimePartitionUtils; import org.apache.iotdb.db.audit.AuditLogger; import org.apache.iotdb.db.auth.AuthorityChecker; import org.apache.iotdb.db.conf.IoTDBConfig; @@ -54,7 +51,6 @@ import org.apache.iotdb.db.protocol.session.SessionManager; import org.apache.iotdb.db.protocol.thrift.OperationType; import org.apache.iotdb.db.queryengine.common.SessionInfo; -import org.apache.iotdb.db.queryengine.common.header.ColumnHeader; import org.apache.iotdb.db.queryengine.common.header.DatasetHeader; import org.apache.iotdb.db.queryengine.common.header.DatasetHeaderFactory; import org.apache.iotdb.db.queryengine.execution.aggregation.AccumulatorFactory; @@ -105,7 +101,6 @@ import org.apache.iotdb.db.schemaengine.SchemaEngine; import org.apache.iotdb.db.schemaengine.schemaregion.ISchemaRegion; import org.apache.iotdb.db.schemaengine.template.TemplateQueryType; -import org.apache.iotdb.db.storageengine.StorageEngine; import org.apache.iotdb.db.storageengine.dataregion.DataRegion; import org.apache.iotdb.db.storageengine.dataregion.read.QueryDataSource; import org.apache.iotdb.db.storageengine.rescon.quotas.DataNodeThrottleQuotaManager; @@ -146,7 +141,6 @@ import org.apache.iotdb.service.rpc.thrift.TSFetchResultsReq; import org.apache.iotdb.service.rpc.thrift.TSFetchResultsResp; import org.apache.iotdb.service.rpc.thrift.TSGetTimeZoneResp; -import org.apache.iotdb.service.rpc.thrift.TSGroupByQueryIntervalReq; import org.apache.iotdb.service.rpc.thrift.TSInsertRecordReq; import org.apache.iotdb.service.rpc.thrift.TSInsertRecordsOfOneDeviceReq; import org.apache.iotdb.service.rpc.thrift.TSInsertRecordsReq; @@ -171,7 +165,6 @@ import org.apache.iotdb.service.rpc.thrift.TSyncTransportMetaInfo; import io.airlift.units.Duration; -import org.apache.commons.lang3.StringUtils; import org.apache.thrift.TException; import org.apache.tsfile.block.column.Column; import org.apache.tsfile.common.conf.TSFileConfig; @@ -1141,72 +1134,6 @@ public TSExecuteStatementResp executeAggregationQueryV2(TSAggregationQueryReq re return executeAggregationQueryInternal(req, SELECT_RESULT); } - @Override - public TSExecuteStatementResp executeGroupByQueryIntervalQuery(TSGroupByQueryIntervalReq req) - throws TException { - - try { - IClientSession clientSession = SESSION_MANAGER.getCurrSessionAndUpdateIdleTime(); - - String database = req.getDatabase(); - if (StringUtils.isEmpty(database)) { - String[] splits = req.getDevice().split("\\."); - database = String.format("%s.%s", splits[0], splits[1]); - } - String deviceId = req.getDevice(); - String measurementId = req.getMeasurement(); - TSDataType dataType = TSDataType.getTsDataType((byte) req.getDataType()); - - // only one database, one device, one time interval - Map> sgNameToQueryParamsMap = new HashMap<>(); - TTimePartitionSlot timePartitionSlot = - TimePartitionUtils.getTimePartitionSlot(req.getStartTime()); - DataPartitionQueryParam queryParam = - new DataPartitionQueryParam( - deviceId, Collections.singletonList(timePartitionSlot), false, false); - sgNameToQueryParamsMap.put(database, Collections.singletonList(queryParam)); - DataPartition dataPartition = partitionFetcher.getDataPartition(sgNameToQueryParamsMap); - List dataRegionList = new ArrayList<>(); - List replicaSets = - dataPartition.getDataRegionReplicaSetWithTimeFilter(deviceId, null); - for (TRegionReplicaSet region : replicaSets) { - dataRegionList.add( - StorageEngine.getInstance() - .getDataRegion(new DataRegionId(region.getRegionId().getId()))); - } - - List blockResult = - executeGroupByQueryInternal( - SESSION_MANAGER.getSessionInfo(clientSession), - deviceId, - measurementId, - dataType, - req.isAligned, - req.getStartTime(), - req.getEndTime(), - req.getInterval(), - req.getAggregationType(), - dataRegionList); - - String outputColumnName = req.getAggregationType().name(); - List columnHeaders = - Collections.singletonList(new ColumnHeader(outputColumnName, dataType)); - DatasetHeader header = new DatasetHeader(columnHeaders, false); - header.setColumnToTsBlockIndexMap(Collections.singletonList(outputColumnName)); - - TSExecuteStatementResp resp = createResponse(header, 1); - TSQueryDataSet queryDataSet = convertTsBlockByFetchSize(blockResult); - resp.setQueryDataSet(queryDataSet); - - return resp; - } catch (Exception e) { - return RpcUtils.getTSExecuteStatementResp( - onQueryException(e, "\"" + req + "\". " + OperationType.EXECUTE_AGG_QUERY)); - } finally { - SESSION_MANAGER.updateIdleTime(); - } - } - @Override public TSFetchResultsResp fetchResultsV2(TSFetchResultsReq req) { long startTime = System.nanoTime(); diff --git a/iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift b/iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift index 1294d4cffbc25..a563b656e23d7 100644 --- a/iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift +++ b/iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift @@ -375,22 +375,6 @@ struct TSAggregationQueryReq { 11: optional bool legalPathNodes } -struct TSGroupByQueryIntervalReq { - 1: required i64 sessionId - 2: required i64 statementId - 3: required string device - 4: required string measurement - 5: required i32 dataType - 6: required common.TAggregationType aggregationType - 7: optional string database - 8: optional i64 startTime - 9: optional i64 endTime - 10: optional i64 interval - 11: optional i32 fetchSize - 12: optional i64 timeout - 13: optional bool isAligned -} - struct TSCreateMultiTimeseriesReq { 1: required i64 sessionId 2: required list paths @@ -557,8 +541,6 @@ service IClientRPCService { TSExecuteStatementResp executeAggregationQueryV2(1:TSAggregationQueryReq req); - TSExecuteStatementResp executeGroupByQueryIntervalQuery(1:TSGroupByQueryIntervalReq req); - TSFetchResultsResp fetchResultsV2(1:TSFetchResultsReq req); TSOpenSessionResp openSession(1:TSOpenSessionReq req);