Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YQ-3157 enable batch script results by size #4860

Merged
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
4 changes: 3 additions & 1 deletion ydb/core/fq/libs/compute/ydb/events/events.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,17 @@ struct TEvYdbCompute {
};

struct TEvFetchScriptResultRequest : public NActors::TEventLocal<TEvFetchScriptResultRequest, EvFetchScriptResultRequest> {
TEvFetchScriptResultRequest(const NKikimr::NOperationId::TOperationId& operationId, int64_t resultSetId, const TString& fetchToken)
TEvFetchScriptResultRequest(const NKikimr::NOperationId::TOperationId& operationId, int64_t resultSetId, const TString& fetchToken, uint64_t rowsLimit)
: OperationId(operationId)
, ResultSetId(resultSetId)
, FetchToken(fetchToken)
, RowsLimit(rowsLimit)
{}

NKikimr::NOperationId::TOperationId OperationId;
int64_t ResultSetId = 0;
TString FetchToken;
uint64_t RowsLimit = 0;
};

struct TEvFetchScriptResultResponse : public NActors::TEventLocal<TEvFetchScriptResultResponse, EvFetchScriptResultResponse> {
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/fq/libs/compute/ydb/result_writer_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class TResultSetWriterActor : public TBaseComputeActor<TResultSetWriterActor> {

void SendFetchScriptResultRequest() {
LastProcessedToken = FetchToken;
Register(new TRetryActor<TEvYdbCompute::TEvFetchScriptResultRequest, TEvYdbCompute::TEvFetchScriptResultResponse, NKikimr::NOperationId::TOperationId, int64_t, TString>(Counters.GetCounters(ERequestType::RT_FETCH_SCRIPT_RESULT), SelfId(), Connector, OperationId, ResultSetId, FetchToken));
Register(new TRetryActor<TEvYdbCompute::TEvFetchScriptResultRequest, TEvYdbCompute::TEvFetchScriptResultResponse, NKikimr::NOperationId::TOperationId, int64_t, TString, uint64_t>(Counters.GetCounters(ERequestType::RT_FETCH_SCRIPT_RESULT), SelfId(), Connector, OperationId, ResultSetId, FetchToken, 0));
}

void SendReplyAndPassAway() {
Expand Down
1 change: 1 addition & 0 deletions ydb/core/fq/libs/compute/ydb/ydb_connector_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class TYdbConnectorActor : public NActors::TActorBootstrapped<TYdbConnectorActor
void Handle(const TEvYdbCompute::TEvFetchScriptResultRequest::TPtr& ev) {
NYdb::NQuery::TFetchScriptResultsSettings settings;
settings.FetchToken(ev->Get()->FetchToken);
settings.RowsLimit(ev->Get()->RowsLimit);
QueryClient
->FetchScriptResults(ev->Get()->OperationId, ev->Get()->ResultSetId, settings)
.Apply([actorSystem = NActors::TActivationContext::ActorSystem(), recipient = ev->Sender, cookie = ev->Cookie, database = ComputeConnection.database()](auto future) {
Expand Down
Loading