[regression](nereids) add test case for partition prune (#26849)
* list selected partition name in explain * add prune partition test case (multi-range key)
This commit is contained in:
@ -222,8 +222,12 @@ public class OneRangePartitionEvaluator
|
||||
if (expr.getDataType() instanceof BooleanType && !(expr instanceof Literal)
|
||||
&& result.childrenResult.stream().anyMatch(childResult ->
|
||||
childResult.columnRanges.values().stream().anyMatch(ColumnRange::isEmptyRange))) {
|
||||
// this assumes that for expression: func(A)
|
||||
// if A reject partition, then func(A) reject partition.
|
||||
// implement visitFunc for Func if Func does not satisfy the above assumption.
|
||||
return new EvaluateRangeResult(BooleanLiteral.FALSE, result.columnRanges, result.childrenResult);
|
||||
}
|
||||
// assumption: for func(A), if A accept range (n, m), then func(A) accept range (n, m).
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@ -1239,8 +1239,11 @@ public class OlapScanNode extends ScanNode {
|
||||
output.append(getRuntimeFilterExplainString(false));
|
||||
}
|
||||
|
||||
output.append(prefix).append(String.format("partitions=%s/%s, tablets=%s/%s", selectedPartitionNum,
|
||||
olapTable.getPartitions().size(), selectedTabletsNum, totalTabletsNum));
|
||||
String selectedPartitions = getSelectedPartitionIds().stream().sorted()
|
||||
.map(id -> olapTable.getPartition(id).getName())
|
||||
.collect(Collectors.joining(","));
|
||||
output.append(prefix).append(String.format("partitions=%s/%s (%s), tablets=%s/%s", selectedPartitionNum,
|
||||
olapTable.getPartitions().size(), selectedPartitions, selectedTabletsNum, totalTabletsNum));
|
||||
// We print up to 3 tablet, and we print "..." if the number is more than 3
|
||||
if (scanTabletIds.size() > 3) {
|
||||
List<Long> firstTenTabletIds = scanTabletIds.subList(0, 3);
|
||||
|
||||
Reference in New Issue
Block a user