Compare commits

...

3 Commits

Author SHA1 Message Date
Nikhil Soni
c28dd1b60e Remove unnecessary tests
This reverts commit 2cc123d34f.
2026-06-23 17:47:03 +05:30
Nikhil Soni
2cc123d34f chore: add tests similar to limit 2026-06-23 17:11:40 +05:30
Nikhil Soni
fb1f6951e5 feat: add support for offset in export api 2026-06-23 17:11:09 +05:30
2 changed files with 6 additions and 1 deletions

View File

@@ -114,6 +114,10 @@ func validateAndApplyDefaultExportLimits(queries []qbtypes.QueryEnvelope) error
return errors.NewInvalidInputf(errors.CodeInvalidInput, "limit cannot be more than %d", MaxExportRowCountLimit)
}
queries[idx].SetLimit(limit)
if queries[idx].GetOffset() < 0 {
return errors.NewInvalidInputf(errors.CodeInvalidInput, "offset must be non-negative")
}
}
return nil
}

View File

@@ -70,12 +70,13 @@ func exportRawDataForSingleQuery(querier querier.Querier, ctx context.Context, o
queries := rangeRequest.CompositeQuery.Queries
rowCountLimit := queries[queryIndex].GetLimit()
startingOffset := queries[queryIndex].GetOffset()
rowCount := 0
for rowCount < rowCountLimit {
chunkSize := min(ChunkSize, rowCountLimit-rowCount)
queries[queryIndex].SetLimit(chunkSize)
queries[queryIndex].SetOffset(rowCount)
queries[queryIndex].SetOffset(startingOffset + rowCount)
response, err := querier.QueryRange(ctx, orgID, rangeRequest)
if err != nil {