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

Fix issue with group by combine operator when limit is zero #13555

Merged
merged 1 commit into from
Jul 8, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ protected IndexedTable(DataSchema dataSchema, boolean hasFinalInput, QueryContex
int trimSize, int trimThreshold, Map<Key, Record> lookupMap) {
super(dataSchema);

Preconditions.checkArgument(resultSize > 0, "Result size should be a non-zero positive integer");
Preconditions.checkArgument(trimSize > 0, "Trim size should be a non-zero positive integer");
Preconditions.checkArgument(trimThreshold > 0, "Trim threshold should be a non-zero positive integer");
Preconditions.checkArgument(resultSize >= 0, "Result size can't be negative");
Preconditions.checkArgument(trimSize >= 0, "Trim size can't be negative");
Preconditions.checkArgument(trimThreshold >= 0, "Trim threshold can't be negative");

_lookupMap = lookupMap;
_hasFinalInput = hasFinalInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3472,6 +3472,13 @@ public void testBooleanAggregation()
testQuery("SELECT BOOL_OR(CAST(Diverted AS BOOLEAN)) FROM mytable");
}

@Test(dataProvider = "useBothQueryEngines")
public void testGroupByAggregationWithLimitZero(boolean useMultiStageQueryEngine)
throws Exception {
setUseMultiStageQueryEngine(useMultiStageQueryEngine);
testQuery("SELECT Origin, SUM(ArrDelay) FROM mytable GROUP BY Origin LIMIT 0");
}

private String buildSkipIndexesOption(String columnsAndIndexes) {
return "SET " + SKIP_INDEXES + "='" + columnsAndIndexes + "'; ";
}
Expand Down
Loading