Skip to content

Commit fda8e90

Browse files
authored
Merge 4c4c5c2 into 736fd80
2 parents 736fd80 + 4c4c5c2 commit fda8e90

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

ydb/core/grpc_services/query/rpc_fetch_script_results.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ using TEvFetchScriptResultsRequest = TGrpcRequestNoOperationCall<Ydb::Query::Fet
2525
Ydb::Query::FetchScriptResultsResponse>;
2626

2727
constexpr i64 MAX_ROWS_LIMIT = 1000;
28-
constexpr i64 MAX_SIZE_LIMIT = 60_MB;
28+
constexpr i64 MAX_SIZE_LIMIT = 50_MB;
2929

3030
class TFetchScriptResultsRPC : public TRpcRequestActor<TFetchScriptResultsRPC, TEvFetchScriptResultsRequest, false> {
3131
public:

ydb/core/kqp/proxy_service/kqp_script_executions.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,9 +2157,9 @@ class TGetScriptExecutionResultQueryActor : public TQueryBase {
21572157
Finish(Ydb::StatusIds::INTERNAL_ERROR, "Result set row is empty");
21582158
return;
21592159
}
2160-
2160+
21612161
i64 rowSize = serializedRow->size();
2162-
if (SizeLimit && ResultSet.rows_size() && ResultSetSize + rowSize > SizeLimit) {
2162+
if (SizeLimit && ResultSet.rows_size() && ResultSetSize + rowSize + AdditionalRowSize > SizeLimit) {
21632163
CancelFetchQuery();
21642164
return;
21652165
}
@@ -2174,6 +2174,12 @@ class TGetScriptExecutionResultQueryActor : public TQueryBase {
21742174
Finish(Ydb::StatusIds::INTERNAL_ERROR, "Result set row is corrupted");
21752175
return;
21762176
}
2177+
2178+
// Initialize AdditionalRowSize
2179+
if (ResultSet.rows_size() == 1) {
2180+
AdditionalRowSize = static_cast<i64>(ResultSet.ByteSizeLong()) - ResultSetSize;
2181+
}
2182+
ResultSetSize += AdditionalRowSize;
21772183
}
21782184

21792185
if (TInstant::Now() + TDuration::Seconds(5) + GetAverageTime() >= Deadline) {
@@ -2209,6 +2215,7 @@ class TGetScriptExecutionResultQueryActor : public TQueryBase {
22092215
const TInstant Deadline;
22102216

22112217
i64 ResultSetSize = 0;
2218+
i64 AdditionalRowSize = 0;
22122219
Ydb::ResultSet ResultSet;
22132220
bool HasMoreResults = false;
22142221
};

ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,6 +1774,10 @@ Y_UNIT_TEST_SUITE(KqpFederatedQuery) {
17741774
}
17751775

17761776
Y_UNIT_TEST(ExecuteScriptWithLargeFile) {
1777+
ExecuteSelectQuery("test_bucket_execute_script_with_large_file", 65_MB, 500000);
1778+
}
1779+
1780+
Y_UNIT_TEST(ExecuteScriptWithThinFile) {
17771781
ExecuteSelectQuery("test_bucket_execute_script_with_large_file", 5_MB, 500000);
17781782
}
17791783
}

0 commit comments

Comments
 (0)