Skip to content
Closed
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
57 changes: 57 additions & 0 deletions client/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,63 @@
}
}

func (s *Session) ExecuteGroupByQueryIntervalQuery(database *string, device, measurement string, aggregationType common.TAggregationType,
dataType int32, startTime *int64, endTime *int64, interval *int64, timeoutMs *int64) (*SessionDataSet, error) {

request := rpc.TSGroupByQueryIntervalReq{SessionId: s.sessionId, StatementId: s.requestStatementId,
Database: database, Device: device, Measurement: measurement, AggregationType: aggregationType, DataType: dataType,
StartTime: startTime, EndTime: endTime, Interval: interval, FetchSize: &s.config.FetchSize,
Timeout: timeoutMs}
if resp, err := s.client.ExecuteGroupByQueryIntervalQuery(context.Background(), &request); err == nil {
if statusErr := VerifySuccess(resp.Status); statusErr == nil {
return NewSessionDataSet("", resp.Columns, resp.DataTypeList, resp.ColumnNameIndexMap, *resp.QueryId, s.client, s.sessionId, resp.QueryDataSet, resp.IgnoreTimeStamp != nil && *resp.IgnoreTimeStamp, s.config.FetchSize, timeoutMs), err
} else {
return nil, statusErr
}
} else {
if s.reconnect() {
request.SessionId = s.sessionId
resp, err = s.client.ExecuteGroupByQueryIntervalQuery(context.Background(), &request)
if statusErr := VerifySuccess(resp.Status); statusErr == nil {
return NewSessionDataSet("", resp.Columns, resp.DataTypeList, resp.ColumnNameIndexMap, *resp.QueryId, s.client, s.sessionId, resp.QueryDataSet, resp.IgnoreTimeStamp != nil && *resp.IgnoreTimeStamp, s.config.FetchSize, timeoutMs), err
} else {
return nil, statusErr
}
}
return nil, err
}
}

//func (s *Session) ExecuteGroupByQuery(database *string, device, measurement string, aggregationType common.TAggregationType,
// dataType int32, startTime *int64, endTime *int64, interval *int64, timeoutMs *int64, isAligned *bool) (*SessionDataSet, error) {
//
// request := rpc.TSGroupByQueryIntervalReq{SessionId: s.sessionId, StatementId: s.requestStatementId,
// Database: database, Device: device, Measurement: measurement, AggregationType: aggregationType, DataType: dataType,
// StartTime: startTime, EndTime: endTime, Interval: interval, FetchSize: &s.config.FetchSize,
// Timeout: timeoutMs, IsAligned: isAligned}
// if resp, err := s.client.ExecuteGroupByQueryIntervalQuery(context.Background(), &request); err == nil {
// if statusErr := VerifySuccess(resp.Status); statusErr == nil {
// // return nil, nil
// return NewSessionDataSet("", resp.Columns, resp.DataTypeList, resp.ColumnNameIndexMap, *resp.QueryId,
// s.client, s.sessionId, resp.QueryDataSet, resp.IgnoreTimeStamp != nil && *resp.IgnoreTimeStamp, s.config.FetchSize, timeoutMs), err
// } else {
// return nil, statusErr
// }
// } else {
// if s.reconnect() {
// request.SessionId = s.sessionId

Check failure on line 613 in client/session.go

View workflow job for this annotation

GitHub Actions / Build (macos-latest, stable)

multiple-value NewSessionDataSet("", resp.Columns, resp.DataTypeList, resp.ColumnNameIndexMap, *resp.QueryId, s.client, s.sessionId, resp.QueryDataSet, resp.IgnoreTimeStamp != nil && *resp.IgnoreTimeStamp, s.config.FetchSize, timeoutMs) (value of type (*SessionDataSet, error)) in single-value context

Check failure on line 613 in client/session.go

View workflow job for this annotation

GitHub Actions / Build (macos-latest, stable)

not enough arguments in call to NewSessionDataSet

Check failure on line 613 in client/session.go

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, 1.13)

not enough arguments in call to NewSessionDataSet

Check failure on line 613 in client/session.go

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, 1.13)

multiple-value NewSessionDataSet() in single-value context
// resp, err = s.client.ExecuteGroupByQueryIntervalQuery(context.Background(), &request)
// if statusErr := VerifySuccess(resp.Status); statusErr == nil {
// return NewSessionDataSet("", resp.Columns, resp.DataTypeList, resp.ColumnNameIndexMap, *resp.QueryId,
// s.client, s.sessionId, resp.QueryDataSet, resp.IgnoreTimeStamp != nil && *resp.IgnoreTimeStamp, s.config.FetchSize, timeoutMs), err
// } else {
// return nil, statusErr
// }
// }
// return nil, err

Check failure on line 622 in client/session.go

View workflow job for this annotation

GitHub Actions / Build (macos-latest, stable)

multiple-value NewSessionDataSet("", resp.Columns, resp.DataTypeList, resp.ColumnNameIndexMap, *resp.QueryId, s.client, s.sessionId, resp.QueryDataSet, resp.IgnoreTimeStamp != nil && *resp.IgnoreTimeStamp, s.config.FetchSize, timeoutMs) (value of type (*SessionDataSet, error)) in single-value context

Check failure on line 622 in client/session.go

View workflow job for this annotation

GitHub Actions / Build (macos-latest, stable)

not enough arguments in call to NewSessionDataSet

Check failure on line 622 in client/session.go

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, 1.13)

not enough arguments in call to NewSessionDataSet

Check failure on line 622 in client/session.go

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, 1.13)

multiple-value NewSessionDataSet() in single-value context
// }
//}

func (s *Session) genTSInsertRecordReq(deviceId string, time int64,
measurements []string,
types []TSDataType,
Expand Down
Loading
Loading