Skip to content

Commit

Permalink
Fix is need accumulate logic (#33211)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyingZC authored Oct 11, 2024
1 parent ec37eb0 commit 4c99716
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,15 @@ private UpdateResponseHeader processExecuteUpdate(final Collection<UpdateResult>
}

private boolean isNeedAccumulate() {
Collection<DataNodeRuleAttribute> ruleAttributes = database.getRuleMetaData().getAttributes(DataNodeRuleAttribute.class);
Collection<String> tableNames = queryContext.getSqlStatementContext() instanceof TableAvailable
? ((TableAvailable) queryContext.getSqlStatementContext()).getTablesContext().getTableNames()
: Collections.emptyList();
return !ruleAttributes.isEmpty() && ruleAttributes.iterator().next().isNeedAccumulate(tableNames);
for (DataNodeRuleAttribute each : database.getRuleMetaData().getAttributes(DataNodeRuleAttribute.class)) {
if (each.isNeedAccumulate(tableNames)) {
return true;
}
}
return false;
}

/**
Expand Down

0 comments on commit 4c99716

Please sign in to comment.