JingsongLi commented on a change in pull request #10210: [FLINK-14800][hive] 
Introduce parallelism inference for HiveSource
URL: https://github.com/apache/flink/pull/10210#discussion_r352567504
 
 

 ##########
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveTableSource.java
 ##########
 @@ -100,10 +110,41 @@ private HiveTableSource(JobConf jobConf, ObjectPath 
tablePath, CatalogTable cata
        }
 
        @Override
-       public InputFormat getInputFormat() {
+       public boolean isBounded() {
+               return true;
+       }
+
+       @Override
+       public DataStream<Row> getDataStream(StreamExecutionEnvironment 
execEnv) {
                if (!initAllPartitions) {
                        initAllPartitions();
                }
+               @SuppressWarnings("unchecked")
+               TypeInformation<Row> typeInfo = (TypeInformation<Row>) 
fromDataTypeToTypeInfo(getProducedDataType());
+               HiveTableInputFormat inputFormat = getInputFormat();
+               DataStreamSource<Row> source = execEnv.createInput(inputFormat, 
typeInfo);
+
+               Configuration conf = GlobalConfiguration.loadConfiguration();
+               if (conf.getBoolean(TABLE_EXEC_HIVE_INFER_SOURCE_PARALLELISM)) {
+                       int max = 
conf.getInteger(TABLE_EXEC_HIVE_INFER_SOURCE_PARALLELISM_MAX);
 
 Review comment:
   It is a config option, it has default value. Don't need force user to 
configure it.

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

Reply via email to