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 2020/10/14 12:20:48 UTC

[GitHub] [flink] TsReaper opened a new pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

TsReaper opened a new pull request #13636:
URL: https://github.com/apache/flink/pull/13636


   ## What is the purpose of the change
   
   The current implementation of `HiveTableSource#createBatchSource` for calculating parallelism directly uses `inputFormat.createInputSplits(0).length` as the number of splits. However `createInputSplits` may be costly as it will read some data from all source files, especially when the table is not partitioned and the number of files are large.
   
   Many Hive tables maintain the number of files in that table, and it's obvious that the number of splits is at least the number of files. So we can try to fetch the number of files (almost without cost) first and if the number of files already exceeds maximum parallelism we can directly use the maximum parallelism without calling `createInputSplits`.
   
   This is a significant optimization on the current Flink TPCDS benchmark, which will create some table with 15000 files without partitioning. This optimization will improve the performance of the whole benchmark by 300s and more.
   
   ## Brief change log
   
    - Optimize parallelism calculating of `HiveTableSource` by checking file number
   
   ## Verifying this change
   
   This change added tests and can be verified as follows: Run newly added test case in `HiveTableSourceITCase`.
   
   ## 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)`: no
     - 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/Mesos, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


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

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



[GitHub] [flink] flinkbot edited a comment on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609",
       "triggerID" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640",
       "triggerID" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8107",
       "triggerID" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b46a6a32ef4964221948656f783d8248db7e60b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640) 
   * ccf58fbc6e8b269f07cc0ba4ad332ca06631b493 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8107) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] JingsongLi commented on a change in pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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



##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveTableSource.java
##########
@@ -210,19 +212,35 @@ private boolean isStreamingSource() {
 								" cannot be less than 1");
 			}
 
-			int splitNum;
 			try {
-				long nano1 = System.nanoTime();
-				splitNum = inputFormat.createInputSplits(0).length;
-				long nano2 = System.nanoTime();
+				// `createInputSplits` is costly,

Review comment:
       Yes, it can be a separate PR.
   You are making the logic more complex, so I think you should cleanup code first.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   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 892ba1e1d9776dd75ed5dd550dc98c4bb6f73bbf (Wed Oct 14 12:23:05 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609",
       "triggerID" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640",
       "triggerID" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b46a6a32ef4964221948656f783d8248db7e60b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640) 
   * ccf58fbc6e8b269f07cc0ba4ad332ca06631b493 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609",
       "triggerID" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640",
       "triggerID" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b46a6a32ef4964221948656f783d8248db7e60b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609",
       "triggerID" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 37a21996231887c5d5b7227d0c38ab07612f3209 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609) 
   * 9b46a6a32ef4964221948656f783d8248db7e60b UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] JingsongLi commented on a change in pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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



##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveTableSource.java
##########
@@ -210,19 +212,35 @@ private boolean isStreamingSource() {
 								" cannot be less than 1");
 			}
 
-			int splitNum;
 			try {
-				long nano1 = System.nanoTime();
-				splitNum = inputFormat.createInputSplits(0).length;
-				long nano2 = System.nanoTime();
+				// `createInputSplits` is costly,

Review comment:
       Can you extract these parallelism inference logic to a dedicated class like `HiveParallelismInference` (Including limit logic)?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609",
       "triggerID" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640",
       "triggerID" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 37a21996231887c5d5b7227d0c38ab07612f3209 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609) 
   * 9b46a6a32ef4964221948656f783d8248db7e60b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot commented on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 37a21996231887c5d5b7227d0c38ab07612f3209 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609",
       "triggerID" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640",
       "triggerID" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8107",
       "triggerID" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d2f035bb2422d0b409164c9953efaa857f4393db",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d2f035bb2422d0b409164c9953efaa857f4393db",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5da742f0e0ec1d9c79832051472749466a847c1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8364",
       "triggerID" : "c5da742f0e0ec1d9c79832051472749466a847c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dfa2662f2b4b5a2c40d4751edb6ab92e0fc8f7ec",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8404",
       "triggerID" : "dfa2662f2b4b5a2c40d4751edb6ab92e0fc8f7ec",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d2f035bb2422d0b409164c9953efaa857f4393db UNKNOWN
   * c5da742f0e0ec1d9c79832051472749466a847c1 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8364) 
   * dfa2662f2b4b5a2c40d4751edb6ab92e0fc8f7ec Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8404) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] TsReaper commented on a change in pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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



##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveTableSource.java
##########
@@ -210,19 +212,35 @@ private boolean isStreamingSource() {
 								" cannot be less than 1");
 			}
 
-			int splitNum;
 			try {
-				long nano1 = System.nanoTime();
-				splitNum = inputFormat.createInputSplits(0).length;
-				long nano2 = System.nanoTime();
+				// `createInputSplits` is costly,

Review comment:
       I don't think this is needed, at least in this PR. This PR is only an optimization and code cleanups should be done in separate PRs.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] TsReaper commented on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   > Thanks for contribution, we should not rely on `StatsSetupConst.NUM_FILES`, because in Hive metastore, these stats information is just a hint, and they may not correct.
   > 
   > We can get file numbers from file system directly. You should make a performance testing for that.
   
   Indeed. I've tested the performance of listing the table file directory and its impact is neglectable (at least for TPCDS benchmark).


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] JingsongLi commented on a change in pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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



##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/util/HiveStatsUtil.java
##########
@@ -69,7 +69,7 @@
 public class HiveStatsUtil {
 	private static final Logger LOG = LoggerFactory.getLogger(HiveStatsUtil.class);
 
-	private static final int DEFAULT_UNKNOWN_STATS_VALUE = -1;
+	public static final int DEFAULT_UNKNOWN_STATS_VALUE = -1;

Review comment:
       Revert




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] JingsongLi merged pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

Posted by GitBox <gi...@apache.org>.
JingsongLi merged pull request #13636:
URL: https://github.com/apache/flink/pull/13636


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609",
       "triggerID" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640",
       "triggerID" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8107",
       "triggerID" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d2f035bb2422d0b409164c9953efaa857f4393db",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d2f035bb2422d0b409164c9953efaa857f4393db",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ccf58fbc6e8b269f07cc0ba4ad332ca06631b493 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8107) 
   * d2f035bb2422d0b409164c9953efaa857f4393db UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609",
       "triggerID" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640",
       "triggerID" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8107",
       "triggerID" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d2f035bb2422d0b409164c9953efaa857f4393db",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d2f035bb2422d0b409164c9953efaa857f4393db",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5da742f0e0ec1d9c79832051472749466a847c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8364",
       "triggerID" : "c5da742f0e0ec1d9c79832051472749466a847c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dfa2662f2b4b5a2c40d4751edb6ab92e0fc8f7ec",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8404",
       "triggerID" : "dfa2662f2b4b5a2c40d4751edb6ab92e0fc8f7ec",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d2f035bb2422d0b409164c9953efaa857f4393db UNKNOWN
   * dfa2662f2b4b5a2c40d4751edb6ab92e0fc8f7ec Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8404) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609",
       "triggerID" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640",
       "triggerID" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8107",
       "triggerID" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d2f035bb2422d0b409164c9953efaa857f4393db",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d2f035bb2422d0b409164c9953efaa857f4393db",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5da742f0e0ec1d9c79832051472749466a847c1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8364",
       "triggerID" : "c5da742f0e0ec1d9c79832051472749466a847c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dfa2662f2b4b5a2c40d4751edb6ab92e0fc8f7ec",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "dfa2662f2b4b5a2c40d4751edb6ab92e0fc8f7ec",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d2f035bb2422d0b409164c9953efaa857f4393db UNKNOWN
   * c5da742f0e0ec1d9c79832051472749466a847c1 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8364) 
   * dfa2662f2b4b5a2c40d4751edb6ab92e0fc8f7ec UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609",
       "triggerID" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640",
       "triggerID" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8107",
       "triggerID" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d2f035bb2422d0b409164c9953efaa857f4393db",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d2f035bb2422d0b409164c9953efaa857f4393db",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c5da742f0e0ec1d9c79832051472749466a847c1",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c5da742f0e0ec1d9c79832051472749466a847c1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ccf58fbc6e8b269f07cc0ba4ad332ca06631b493 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8107) 
   * d2f035bb2422d0b409164c9953efaa857f4393db UNKNOWN
   * c5da742f0e0ec1d9c79832051472749466a847c1 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13636: [FLINK-19641][hive] Optimize parallelism calculating of HiveTableSource by checking file number

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7609",
       "triggerID" : "37a21996231887c5d5b7227d0c38ab07612f3209",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7640",
       "triggerID" : "9b46a6a32ef4964221948656f783d8248db7e60b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8107",
       "triggerID" : "ccf58fbc6e8b269f07cc0ba4ad332ca06631b493",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ccf58fbc6e8b269f07cc0ba4ad332ca06631b493 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8107) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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