You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/01/10 03:03:05 UTC

[GitHub] [flink] springMoon opened a new pull request #18309: [FLINK-25582] [TABLE SQL / API] flink sql kafka source cannot special custom parallelism

springMoon opened a new pull request #18309:
URL: https://github.com/apache/flink/pull/18309


   ## What is the purpose of the change
   
   flink sql kafka source cannot special custom parallelism
   
   
   ## Brief change log
   
   flink sql kafka source cannot special custom parallelism
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   Added integration tests for end-to-end deployment with large payloads (100MB)
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: yes
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? yes
     - If yes, how is the feature documented? docs
   


-- 
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: issues-unsubscribe@flink.apache.org

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



[GitHub] [flink] flinkbot edited a comment on pull request #18309: [FLINK-25582] [TABLE SQL / API] flink sql kafka source cannot special custom parallelism

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18309:
URL: https://github.com/apache/flink/pull/18309#issuecomment-1008506052


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "57824ba5e17369b016e6f8838b6a713863573c70",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=29156",
       "triggerID" : "57824ba5e17369b016e6f8838b6a713863573c70",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 57824ba5e17369b016e6f8838b6a713863573c70 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=29156) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

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



[GitHub] [flink] springMoon closed pull request #18309: [FLINK-25582] [TABLE SQL / API] flink sql kafka source cannot special custom parallelism

Posted by GitBox <gi...@apache.org>.
springMoon closed pull request #18309:
URL: https://github.com/apache/flink/pull/18309


   


-- 
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: issues-unsubscribe@flink.apache.org

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



[GitHub] [flink] lmagic233 commented on pull request #18309: [FLINK-25582] [TABLE SQL / API] flink sql kafka source cannot special custom parallelism

Posted by GitBox <gi...@apache.org>.
lmagic233 commented on pull request #18309:
URL: https://github.com/apache/flink/pull/18309#issuecomment-1011157388


   Hi @alpreu @springMoon , shall we consider the plan suggested in [FLIP-146](https://cwiki.apache.org/confluence/display/FLINK/FLIP-146%3A+Improve+new+TableSource+and+TableSink+interfaces)? 
   
   That is to say, we should implement `ParallelismProvider` on different types of `ScanRuntimeProvider`s, as well as support parallelism inference whenever available. Besides Kafka source, there are also many other sources which call for this feature, so maybe we need to reach an agreement on a more generic solution.
   
   WDYT?


-- 
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: issues-unsubscribe@flink.apache.org

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



[GitHub] [flink] flinkbot commented on pull request #18309: [FLINK-25582] [TABLE SQL / API] flink sql kafka source cannot special custom parallelism

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #18309:
URL: https://github.com/apache/flink/pull/18309#issuecomment-1008506471


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 57824ba5e17369b016e6f8838b6a713863573c70 (Mon Jan 10 03:08:02 UTC 2022)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-25582).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

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



[GitHub] [flink] springMoon commented on pull request #18309: [FLINK-25582] [TABLE SQL / API] flink sql kafka source cannot special custom parallelism

Posted by GitBox <gi...@apache.org>.
springMoon commented on pull request #18309:
URL: https://github.com/apache/flink/pull/18309#issuecomment-1011819956






-- 
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: issues-unsubscribe@flink.apache.org

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



[GitHub] [flink] flinkbot commented on pull request #18309: [FLINK-25582] [TABLE SQL / API] flink sql kafka source cannot special custom parallelism

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #18309:
URL: https://github.com/apache/flink/pull/18309#issuecomment-1008506052


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "57824ba5e17369b016e6f8838b6a713863573c70",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "57824ba5e17369b016e6f8838b6a713863573c70",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 57824ba5e17369b016e6f8838b6a713863573c70 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

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



[GitHub] [flink] springMoon commented on pull request #18309: [FLINK-25582] [TABLE SQL / API] flink sql kafka source cannot special custom parallelism

Posted by GitBox <gi...@apache.org>.
springMoon commented on pull request #18309:
URL: https://github.com/apache/flink/pull/18309#issuecomment-1011819020


   @alpreu   thanks for review, but @lmagic233  is right, generic solution for custom source parallelism is better


-- 
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: issues-unsubscribe@flink.apache.org

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



[GitHub] [flink] springMoon removed a comment on pull request #18309: [FLINK-25582] [TABLE SQL / API] flink sql kafka source cannot special custom parallelism

Posted by GitBox <gi...@apache.org>.
springMoon removed a comment on pull request #18309:
URL: https://github.com/apache/flink/pull/18309#issuecomment-1011819956


   @alpreu   thanks for review, but @lmagic233  is right, generic solution for custom source parallelism is better


-- 
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: issues-unsubscribe@flink.apache.org

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



[GitHub] [flink] flinkbot edited a comment on pull request #18309: [FLINK-25582] [TABLE SQL / API] flink sql kafka source cannot special custom parallelism

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #18309:
URL: https://github.com/apache/flink/pull/18309#issuecomment-1008506052


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "57824ba5e17369b016e6f8838b6a713863573c70",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=29156",
       "triggerID" : "57824ba5e17369b016e6f8838b6a713863573c70",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 57824ba5e17369b016e6f8838b6a713863573c70 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=29156) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

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



[GitHub] [flink] alpreu commented on a change in pull request #18309: [FLINK-25582] [TABLE SQL / API] flink sql kafka source cannot special custom parallelism

Posted by GitBox <gi...@apache.org>.
alpreu commented on a change in pull request #18309:
URL: https://github.com/apache/flink/pull/18309#discussion_r783060124



##########
File path: flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/table/KafkaDynamicSource.java
##########
@@ -195,6 +201,8 @@ public KafkaDynamicSource(
         this.startupTimestampMillis = startupTimestampMillis;
         this.upsertMode = upsertMode;
         this.tableIdentifier = tableIdentifier;
+        Preconditions.checkArgument(parallelism >= 1, "source.parallelism must be at least 1.");

Review comment:
       I think this should be `sourceParallelism`

##########
File path: flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/table/KafkaDynamicSource.java
##########
@@ -195,6 +201,8 @@ public KafkaDynamicSource(
         this.startupTimestampMillis = startupTimestampMillis;
         this.upsertMode = upsertMode;
         this.tableIdentifier = tableIdentifier;
+        Preconditions.checkArgument(parallelism >= 1, "source.parallelism must be at least 1.");

Review comment:
       Are you making sure it cannot throw a NullPointerException here? The passed in Integer could be null, right?

##########
File path: flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/table/KafkaDynamicTableFactoryTest.java
##########
@@ -912,7 +948,39 @@ private static KafkaDynamicSource createExpectedScanSource(
                 FactoryMocks.IDENTIFIER.asSummaryString());
     }
 
-    private static KafkaDynamicSink createExpectedSink(
+    private static KafkaDynamicSource createExpectedScanSource(

Review comment:
       Same as above, rather reuse the current constructor

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/common/CommonExecCalc.java
##########
@@ -99,12 +99,20 @@ protected CommonExecCalc(
                         JavaScalaConversionUtil.toScala(Optional.ofNullable(this.condition)),
                         retainHeader,
                         getClass().getSimpleName());
+
+        // update calc operator parallelism to default parallelism
+        int parallelism = inputTransform.getParallelism();
+        int defaultParallelism = ExecutionConfig.PARALLELISM_DEFAULT;
+        if (parallelism != defaultParallelism) {
+            parallelism = defaultParallelism;
+        }
+

Review comment:
       Can you explain what is the reason we are adding this?

##########
File path: flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/table/KafkaDynamicTableFactory.java
##########
@@ -374,7 +380,41 @@ protected KafkaDynamicSource createKafkaTableSource(
                 specificStartupOffsets,
                 startupTimestampMillis,
                 false,
-                tableIdentifier);
+                tableIdentifier,
+                null);
+    }
+
+    protected KafkaDynamicSource createKafkaTableSource(

Review comment:
       I believe it would be better to not clone but modify the current constructor and make `sourceParallelism`nullable

##########
File path: flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/table/KafkaDynamicTableFactoryTest.java
##########
@@ -222,6 +223,41 @@ public void testTableSource() {
         assertKafkaSource(provider);
     }
 
+    @Test
+    public void testTableSourceWithParallelism() {

Review comment:
       Are you really asserting that the source parallelism matches the expected value?




-- 
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: issues-unsubscribe@flink.apache.org

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