zhangjun888 commented on a change in pull request #11398: [FLINK-16413]Reduce
hive source parallelism when limit push down
URL: https://github.com/apache/flink/pull/11398#discussion_r392114556
##########
File path:
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveTableSource.java
##########
@@ -168,7 +168,9 @@ public boolean isBounded() {
} catch (IOException e) {
throw new FlinkHiveException(e);
}
- source.setParallelism(Math.min(Math.max(1, splitNum),
max));
+ int parallelism = Math.min(Math.max(1, splitNum), max);
+ parallelism = limit > 0l ? Math.min(parallelism,
(int)limit) : parallelism;
Review comment:
hi,jingsong:
parallelism is int type, limit is long type , If it is 0, not 0l, the system
cannot be compiled,Math.min() will throw a exception. In addition, because the
system default maximum parallelism is 1000, if limit > 1000,
Math.min(parallelism, (int) limit) will take the minimum of 1000, (int)limit is
only to do a type cast.
I will add the comment and the Test Class later
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services