ableegoldman commented on a change in pull request #9582:
URL: https://github.com/apache/kafka/pull/9582#discussion_r523175703



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopologyBuilder.java
##########
@@ -410,18 +410,6 @@ public final void addSource(final Topology.AutoOffsetReset 
offsetReset,
             }
         }
 
-        for (final Pattern otherPattern : earliestResetPatterns) {
-            if (topicPattern.pattern().contains(otherPattern.pattern()) || 
otherPattern.pattern().contains(topicPattern.pattern())) {
-                throw new TopologyException("Pattern " + topicPattern + " will 
overlap with another pattern " + otherPattern + " already been registered by 
another source");
-            }
-        }
-
-        for (final Pattern otherPattern : latestResetPatterns) {
-            if (topicPattern.pattern().contains(otherPattern.pattern()) || 
otherPattern.pattern().contains(topicPattern.pattern())) {
-                throw new TopologyException("Pattern " + topicPattern + " will 
overlap with another pattern " + otherPattern + " already been registered by 
another source");
-            }
-        }
-

Review comment:
       I think in this case we were matching whether the pattern's string was a 
literal substring of another pattern's string, not whether the regexes 
themselves are substrings. So `topi*` would not be a substring of `topic*` 
because `topi*` is not contained literally within the string `topic*`. It's not 
doing a smart regex-matching, just a dumb  literal string comparison




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to