File tree 2 files changed +14
-3
lines changed 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -2109,8 +2109,8 @@ class TGetScriptExecutionResultQueryActor : public TQueryBase {
2109
2109
Finish (Ydb::StatusIds::INTERNAL_ERROR, " Result set row is empty" );
2110
2110
return ;
2111
2111
}
2112
-
2113
- i64 rowSize = serializedRow->size ();
2112
+
2113
+ i64 rowSize = serializedRow->size () + AdditionalRowSize ;
2114
2114
if (SizeLimit && ResultSet.rows_size () && ResultSetSize + rowSize > SizeLimit) {
2115
2115
CancelFetchQuery ();
2116
2116
return ;
@@ -2121,11 +2121,17 @@ class TGetScriptExecutionResultQueryActor : public TQueryBase {
2121
2121
return ;
2122
2122
}
2123
2123
2124
- ResultSetSize += rowSize;
2125
2124
if (!ResultSet.add_rows ()->ParseFromString (*serializedRow)) {
2126
2125
Finish (Ydb::StatusIds::INTERNAL_ERROR, " Result set row is corrupted" );
2127
2126
return ;
2128
2127
}
2128
+
2129
+ // Initialize AdditionalRowSize
2130
+ if (ResultSet.rows_size () == 1 ) {
2131
+ AdditionalRowSize = static_cast <i64>(ResultSet.ByteSizeLong ()) - ResultSetSize - rowSize;
2132
+ rowSize += AdditionalRowSize;
2133
+ }
2134
+ ResultSetSize += rowSize;
2129
2135
}
2130
2136
2131
2137
if (TInstant::Now () + TDuration::Seconds (5 ) + GetAverageTime () >= Deadline) {
@@ -2161,6 +2167,7 @@ class TGetScriptExecutionResultQueryActor : public TQueryBase {
2161
2167
const TInstant Deadline;
2162
2168
2163
2169
i64 ResultSetSize = 0 ;
2170
+ i64 AdditionalRowSize = 0 ;
2164
2171
Ydb::ResultSet ResultSet;
2165
2172
bool HasMoreResults = false ;
2166
2173
};
Original file line number Diff line number Diff line change @@ -1786,6 +1786,10 @@ Y_UNIT_TEST_SUITE(KqpFederatedQuery) {
1786
1786
}
1787
1787
1788
1788
Y_UNIT_TEST (ExecuteScriptWithLargeFile) {
1789
+ ExecuteSelectQuery (" test_bucket_execute_script_with_large_file" , 65_MB, 500000 );
1790
+ }
1791
+
1792
+ Y_UNIT_TEST (ExecuteScriptWithThinFile) {
1789
1793
ExecuteSelectQuery (" test_bucket_execute_script_with_large_file" , 5_MB, 500000 );
1790
1794
}
1791
1795
}
You can’t perform that action at this time.
0 commit comments