[Fix](executor)Fix backend_active_tasks only scan one be (#35490)

## Proposed changes
Fix ```select * from backend_active_tasks``` but only return one random
be info.
This commit is contained in:
wangbo
2024-05-28 11:48:42 +08:00
committed by GitHub
parent 238e218312
commit f0e883c968

View File

@ -55,10 +55,17 @@ import java.util.Set;
public class BackendPartitionedSchemaScanNode extends SchemaScanNode {
public static final Set<String> BACKEND_TABLE = new HashSet<>();
// NOTE: when add a new schema table for BackendPartitionedSchemaScanNode,
// you need to the table's backend column id name to BACKEND_ID_COLUMN_SET
// it's used to backend pruner, see computePartitionInfo;
public static final Set<String> BEACKEND_ID_COLUMN_SET = new HashSet<>();
static {
BACKEND_TABLE.add("rowsets");
BEACKEND_ID_COLUMN_SET.add("backend_id");
BACKEND_TABLE.add("backend_active_tasks");
BEACKEND_ID_COLUMN_SET.add("be_id");
}
public static boolean isBackendPartitionedSchemaTable(String tableName) {
@ -130,7 +137,7 @@ public class BackendPartitionedSchemaScanNode extends SchemaScanNode {
private void computePartitionInfo() throws AnalysisException {
List<Column> partitionColumns = new ArrayList<>();
for (SlotDescriptor slotDesc : desc.getSlots()) {
if ("BACKEND_ID".equalsIgnoreCase(slotDesc.getColumn().getName())) {
if (BEACKEND_ID_COLUMN_SET.contains(slotDesc.getColumn().getName().toLowerCase())) {
partitionColumns.add(slotDesc.getColumn());
break;
}