You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "lightzhao (via GitHub)" <gi...@apache.org> on 2023/01/23 09:54:35 UTC

[GitHub] [incubator-seatunnel] lightzhao opened a new pull request, #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

lightzhao opened a new pull request, #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989

   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-seatunnel/issues).
   
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   
   -->
   
   ## Purpose of this pull request
   When the user does not set the topic-pattern option, it should be judged whether there is a setting, otherwise the following exception will appear.
   <img width="1390" alt="image" src="https://user-images.githubusercontent.com/40714172/214010793-f7cf5f57-f963-48fc-8cc2-f9ae0674cd1d.png">
   
   
   ## Check list
   
   * [ ] Code changed are covered with tests, or it does not need tests for reason:
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-seatunnel/tree/dev/docs
   * [ ] If you are contributing the connector code, please check that the following files are updated:
     1. Update change log that in connector document. For more details you can refer to [connector-v2](https://github.com/apache/incubator-seatunnel/tree/dev/docs/en/connector-v2)
     2. Update [plugin-mapping.properties](https://github.com/apache/incubator-seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     3. Update the pom file of [seatunnel-dist](https://github.com/apache/incubator-seatunnel/blob/dev/seatunnel-dist/pom.xml)
   * [ ] Update the [`release-note`](https://github.com/apache/incubator-seatunnel/blob/dev/release-note.md).


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] lightzhao commented on a diff in pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "lightzhao (via GitHub)" <gi...@apache.org>.
lightzhao commented on code in PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1092693953


##########
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:
##########
@@ -213,12 +213,14 @@ private void setPartitionDiscoverer(Config config) {
         if (StringUtils.isNotBlank(topic)) {
             this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ",")));
         }
-        String topicPattern = config.getString(TOPIC_PATTERN.key());
-        if (StringUtils.isNotBlank(topicPattern)) {
-            if (this.partitionDiscoverer != null) {
-                throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+        if (config.hasPath(TOPIC_PATTERN.key())) {

Review Comment:
   The exclusive configuration of these two parameters has been added.
   <img width="929" alt="image" src="https://user-images.githubusercontent.com/40714172/215929458-88913775-5c78-48ed-a594-cb8b4e41057d.png">
   



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] lightzhao commented on a diff in pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "lightzhao (via GitHub)" <gi...@apache.org>.
lightzhao commented on code in PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1090291612


##########
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:
##########
@@ -213,12 +213,14 @@ private void setPartitionDiscoverer(Config config) {
         if (StringUtils.isNotBlank(topic)) {
             this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ",")));
         }
-        String topicPattern = config.getString(TOPIC_PATTERN.key());
-        if (StringUtils.isNotBlank(topicPattern)) {
-            if (this.partitionDiscoverer != null) {
-                throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+        if (config.hasPath(TOPIC_PATTERN.key())) {
+            String topicPattern = config.getString(TOPIC_PATTERN.key());
+            if (StringUtils.isNotBlank(topicPattern)) {
+                if (this.partitionDiscoverer != null) {
+                    throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+                }

Review Comment:
   it needs.



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "CalvinKirs (via GitHub)" <gi...@apache.org>.
CalvinKirs commented on code in PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1090297180


##########
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:
##########
@@ -213,12 +213,14 @@ private void setPartitionDiscoverer(Config config) {
         if (StringUtils.isNotBlank(topic)) {
             this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ",")));
         }
-        String topicPattern = config.getString(TOPIC_PATTERN.key());
-        if (StringUtils.isNotBlank(topicPattern)) {
-            if (this.partitionDiscoverer != null) {
-                throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+        if (config.hasPath(TOPIC_PATTERN.key())) {
+            String topicPattern = config.getString(TOPIC_PATTERN.key());
+            if (StringUtils.isNotBlank(topicPattern)) {
+                if (this.partitionDiscoverer != null) {
+                    throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+                }

Review Comment:
   I mean, if these two parameters are mutually exclusive, then they should be verified in the check phase, not here. so it is redundant.  



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] lightzhao commented on a diff in pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "lightzhao (via GitHub)" <gi...@apache.org>.
lightzhao commented on code in PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1090226852


##########
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:
##########
@@ -213,12 +213,14 @@ private void setPartitionDiscoverer(Config config) {
         if (StringUtils.isNotBlank(topic)) {
             this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ",")));
         }
-        String topicPattern = config.getString(TOPIC_PATTERN.key());
-        if (StringUtils.isNotBlank(topicPattern)) {
-            if (this.partitionDiscoverer != null) {
-                throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+        if (config.hasPath(TOPIC_PATTERN.key())) {
+            String topicPattern = config.getString(TOPIC_PATTERN.key());
+            if (StringUtils.isNotBlank(topicPattern)) {
+                if (this.partitionDiscoverer != null) {
+                    throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+                }
+                this.partitionDiscoverer = new TopicPatternDiscoverer(Pattern.compile(topicPattern));
             }

Review Comment:
   I don't understand what you mean. I just judge whether the topic-pattern parameter is configured.



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "CalvinKirs (via GitHub)" <gi...@apache.org>.
CalvinKirs commented on code in PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1090245960


##########
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:
##########
@@ -213,12 +213,14 @@ private void setPartitionDiscoverer(Config config) {
         if (StringUtils.isNotBlank(topic)) {
             this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ",")));
         }
-        String topicPattern = config.getString(TOPIC_PATTERN.key());
-        if (StringUtils.isNotBlank(topicPattern)) {
-            if (this.partitionDiscoverer != null) {
-                throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+        if (config.hasPath(TOPIC_PATTERN.key())) {
+            String topicPattern = config.getString(TOPIC_PATTERN.key());
+            if (StringUtils.isNotBlank(topicPattern)) {
+                if (this.partitionDiscoverer != null) {
+                    throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+                }

Review Comment:
   Is this redundant?



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] lightzhao commented on a diff in pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "lightzhao (via GitHub)" <gi...@apache.org>.
lightzhao commented on code in PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1096341934


##########
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:
##########
@@ -213,12 +213,11 @@ private void setPartitionDiscoverer(Config config) {
         if (StringUtils.isNotBlank(topic)) {
             this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ",")));

Review Comment:
   done.



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "CalvinKirs (via GitHub)" <gi...@apache.org>.
CalvinKirs commented on code in PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1095336313


##########
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:
##########
@@ -213,12 +213,14 @@ private void setPartitionDiscoverer(Config config) {
         if (StringUtils.isNotBlank(topic)) {
             this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ",")));
         }
-        String topicPattern = config.getString(TOPIC_PATTERN.key());
-        if (StringUtils.isNotBlank(topicPattern)) {
-            if (this.partitionDiscoverer != null) {
-                throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+        if (config.hasPath(TOPIC_PATTERN.key())) {

Review Comment:
   back to this question. https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1090297180
   



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] lightzhao commented on a diff in pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "lightzhao (via GitHub)" <gi...@apache.org>.
lightzhao commented on code in PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1090306124


##########
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:
##########
@@ -213,12 +213,14 @@ private void setPartitionDiscoverer(Config config) {
         if (StringUtils.isNotBlank(topic)) {
             this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ",")));
         }
-        String topicPattern = config.getString(TOPIC_PATTERN.key());
-        if (StringUtils.isNotBlank(topicPattern)) {
-            if (this.partitionDiscoverer != null) {
-                throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+        if (config.hasPath(TOPIC_PATTERN.key())) {
+            String topicPattern = config.getString(TOPIC_PATTERN.key());
+            if (StringUtils.isNotBlank(topicPattern)) {
+                if (this.partitionDiscoverer != null) {
+                    throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+                }

Review Comment:
   I think the judgment here also belongs to the check phase.



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] TaoZex commented on pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "TaoZex (via GitHub)" <gi...@apache.org>.
TaoZex commented on PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#issuecomment-1400107811

   Is topic-pattern a required parameter?


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] EricJoy2048 commented on a diff in pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "EricJoy2048 (via GitHub)" <gi...@apache.org>.
EricJoy2048 commented on code in PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1091854229


##########
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:
##########
@@ -213,12 +213,14 @@ private void setPartitionDiscoverer(Config config) {
         if (StringUtils.isNotBlank(topic)) {
             this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ",")));
         }
-        String topicPattern = config.getString(TOPIC_PATTERN.key());
-        if (StringUtils.isNotBlank(topicPattern)) {
-            if (this.partitionDiscoverer != null) {
-                throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+        if (config.hasPath(TOPIC_PATTERN.key())) {

Review Comment:
   If `TOPIC_PATTERN` and `TOPIC` are exclusive, you need add `exclusive(TOPIC_PATTERN, TOPIC)` in OptionRule. And you can reference https://github.com/apache/incubator-seatunnel/blob/dev/seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/sink/KafkaSinkFactory.java



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] Hisoka-X merged pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X merged PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "CalvinKirs (via GitHub)" <gi...@apache.org>.
CalvinKirs commented on code in PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1090200129


##########
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:
##########
@@ -213,12 +213,14 @@ private void setPartitionDiscoverer(Config config) {
         if (StringUtils.isNotBlank(topic)) {
             this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ",")));
         }
-        String topicPattern = config.getString(TOPIC_PATTERN.key());
-        if (StringUtils.isNotBlank(topicPattern)) {
-            if (this.partitionDiscoverer != null) {
-                throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+        if (config.hasPath(TOPIC_PATTERN.key())) {
+            String topicPattern = config.getString(TOPIC_PATTERN.key());
+            if (StringUtils.isNotBlank(topicPattern)) {
+                if (this.partitionDiscoverer != null) {
+                    throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+                }
+                this.partitionDiscoverer = new TopicPatternDiscoverer(Pattern.compile(topicPattern));
             }

Review Comment:
   If these two parameters are mutually exclusive, we should prompt the user during the check phase, not here.



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "CalvinKirs (via GitHub)" <gi...@apache.org>.
CalvinKirs commented on code in PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1095886735


##########
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:
##########
@@ -213,12 +213,11 @@ private void setPartitionDiscoverer(Config config) {
         if (StringUtils.isNotBlank(topic)) {
             this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ",")));

Review Comment:
   `topic` should use `config.hasPath(TOPIC_PATTERN.key()` judge whether there is



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] lightzhao commented on a diff in pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "lightzhao (via GitHub)" <gi...@apache.org>.
lightzhao commented on code in PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#discussion_r1095527364


##########
seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:
##########
@@ -213,12 +213,14 @@ private void setPartitionDiscoverer(Config config) {
         if (StringUtils.isNotBlank(topic)) {
             this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ",")));
         }
-        String topicPattern = config.getString(TOPIC_PATTERN.key());
-        if (StringUtils.isNotBlank(topicPattern)) {
-            if (this.partitionDiscoverer != null) {
-                throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key()));
+        if (config.hasPath(TOPIC_PATTERN.key())) {

Review Comment:
   ok, redundancy judgment deleted.
   



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] lightzhao commented on pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "lightzhao (via GitHub)" <gi...@apache.org>.
lightzhao commented on PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#issuecomment-1414657821

   @EricJoy2048 @Hisoka-X PTAL


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] lightzhao commented on pull request #3989: [Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug.

Posted by "lightzhao (via GitHub)" <gi...@apache.org>.
lightzhao commented on PR #3989:
URL: https://github.com/apache/incubator-seatunnel/pull/3989#issuecomment-1400156347

   > Is topic-pattern a required parameter?
   
   It's not required parameter.


-- 
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: commits-unsubscribe@seatunnel.apache.org

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