kfaraz commented on code in PR #20063:
URL: https://github.com/apache/druid/pull/20063#discussion_r3820893177
##########
server/src/main/java/org/apache/druid/metadata/SQLMetadataRuleManager.java:
##########
@@ -336,7 +321,9 @@ public boolean overrideRule(final String dataSource, final
List<Rule> newRules,
final String ruleString;
try {
ruleString = jsonMapper.writeValueAsString(newRules);
- if
(ruleString.equals(jsonMapper.writeValueAsString(rules.get().get(dataSource))))
{
+ // Deliberately a nullable lookup: an unknown datasource must not
compare equal to an
+ // empty rule list, otherwise setting empty rules on it would silently
be a no-op.
Review Comment:
Does it make a difference?
A datasource having no entry in the rule map (i.e. an unknown datasource)
has the same effect as a datasource explicitly having an empty list in the rule
map. The effective rules in both the cases would be the cluster level rules
only.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]