mirror of https://github.com/apache/druid.git
Created an error message for when someone tries to time order a result
set > threshold limit
This commit is contained in:
parent
e8a4b49044
commit
7e872a8ebc
|
@ -91,14 +91,14 @@ public class ScanQueryQueryToolChest extends QueryToolChest<ScanResultValue, Sca
|
|||
}
|
||||
};
|
||||
|
||||
if (scanQuery.getTimeOrder().equals(ScanQuery.TIME_ORDER_NONE) ||
|
||||
scanQuery.getLimit() > maxRowsForInMemoryTimeOrdering) {
|
||||
if (scanQuery.getTimeOrder().equals(ScanQuery.TIME_ORDER_NONE)) {
|
||||
if (scanQuery.getLimit() == Long.MAX_VALUE) {
|
||||
return runner.run(queryPlusWithNonNullLegacy, responseContext);
|
||||
}
|
||||
return new BaseSequence<ScanResultValue, ScanQueryLimitRowIterator>(scanQueryLimitRowIteratorMaker);
|
||||
} else if (scanQuery.getTimeOrder().equals(ScanQuery.TIME_ORDER_ASCENDING) ||
|
||||
scanQuery.getTimeOrder().equals(ScanQuery.TIME_ORDER_DESCENDING)) {
|
||||
} else if ((scanQuery.getTimeOrder().equals(ScanQuery.TIME_ORDER_ASCENDING) ||
|
||||
scanQuery.getTimeOrder().equals(ScanQuery.TIME_ORDER_DESCENDING))
|
||||
&& scanQuery.getLimit() <= scanQueryConfig.getMaxRowsTimeOrderedInMemory()) {
|
||||
Iterator<ScanResultValue> scanResultIterator = scanQueryLimitRowIteratorMaker.make();
|
||||
|
||||
return new BaseSequence(
|
||||
|
@ -119,6 +119,13 @@ public class ScanQueryQueryToolChest extends QueryToolChest<ScanResultValue, Sca
|
|||
CloseQuietly.close(iterFromMake);
|
||||
}
|
||||
});
|
||||
} else if (scanQuery.getLimit() > scanQueryConfig.getMaxRowsTimeOrderedInMemory()) {
|
||||
throw new UOE(
|
||||
"Time ordering for result set limit of %s is not supported. Try lowering the "
|
||||
+ "result set size to less than or equal to the time ordering limit of %s.",
|
||||
scanQuery.getLimit(),
|
||||
scanQueryConfig.getMaxRowsTimeOrderedInMemory()
|
||||
);
|
||||
} else {
|
||||
throw new UOE("Time ordering [%s] is not supported", scanQuery.getTimeOrder());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue