Browse Source

HPCC-25961 Prevent 'too big' error on files with unknown row count

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith 4 years ago
parent
commit
d1b55252b3
1 changed files with 7 additions and 1 deletions
  1. 7 1
      esp/services/ws_workunits/ws_workunitsService.cpp

+ 7 - 1
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -2884,8 +2884,14 @@ INewResultSet* createFilteredResultSet(INewResultSet* result, IArrayOf<IConstNam
 
 static bool isResultRequestSzTooBig(unsigned __int64 start, unsigned requestCount, unsigned __int64 resultSz, unsigned resultRows, unsigned __int64 limitSz)
 {
-    if ((0 == requestCount) || (0 == resultRows))
+    if ((0 == start) && (0 == requestCount)) // all being requested
         return resultSz > limitSz;
+    else if (0 == resultRows)
+    {
+        // if resultRows == 0, have to assume the row count of the file is unknown (e.g. because sprayed and no meta)
+        // There is insuficient information to validate if the result will be too big.
+        return false;
+    }
     else
     {
         if (start+requestCount > resultRows)