[GitHub] [flink] Myracle commented on a change in pull request #17988: [FLINK-25010][Connectors/Hive] Speed up hive's createMRSplits by multi thread
Myracle commented on a change in pull request #17988: URL: https://github.com/apache/flink/pull/17988#discussion_r779273903 ## File path: docs/content.zh/docs/connectors/table/hive/hive_read_write.md ## @@ -163,6 +163,12 @@ following parameters in `TableConfig` (note that these parameters affect all sou Integer Sets max infer parallelism for source operator. + +table.exec.hive.load-partition-splits.thread-num Review comment: @wuchong Sorry for the wrong place. I have modified it. Please review it again. Thanks. -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [flink] Myracle commented on a change in pull request #17988: [FLINK-25010][Connectors/Hive] Speed up hive's createMRSplits by multi thread
Myracle commented on a change in pull request #17988: URL: https://github.com/apache/flink/pull/17988#discussion_r775101619 ## File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveOptions.java ## @@ -51,4 +51,11 @@ .withDescription( "If it is false, using flink native writer to write parquet and orc files; " + "If it is true, using hadoop mapred record writer to write parquet and orc files."); + +public static final ConfigOption TABLE_EXEC_HIVE_PARTITION_SPLIT_THREAD_NUM = +key("table.exec.hive.partition-split.thread.num") Review comment: @wuchong Good suggestion! I have modified it. Can you review it again? Thank you. -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [flink] Myracle commented on a change in pull request #17988: [FLINK-25010][Connectors/Hive] Speed up hive's createMRSplits by multi thread
Myracle commented on a change in pull request #17988: URL: https://github.com/apache/flink/pull/17988#discussion_r775101619 ## File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveOptions.java ## @@ -51,4 +51,11 @@ .withDescription( "If it is false, using flink native writer to write parquet and orc files; " + "If it is true, using hadoop mapred record writer to write parquet and orc files."); + +public static final ConfigOption TABLE_EXEC_HIVE_PARTITION_SPLIT_THREAD_NUM = +key("table.exec.hive.partition-split.thread.num") Review comment: Good suggestion! I have modified it. Can you review it again? Thank you. -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [flink] Myracle commented on a change in pull request #17988: [FLINK-25010][Connectors/Hive] Speed up hive's createMRSplits by multi thread
Myracle commented on a change in pull request #17988: URL: https://github.com/apache/flink/pull/17988#discussion_r763732056 ## File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/MRSplitsGetter.java ## @@ -0,0 +1,140 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.connectors.hive; + +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.hive.metastore.api.StorageDescriptor; +import org.apache.hadoop.mapred.InputFormat; +import org.apache.hadoop.mapred.InputSplit; +import org.apache.hadoop.mapred.JobConf; +import org.apache.hadoop.util.ReflectionUtils; +import org.apache.hadoop.util.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import static org.apache.flink.util.concurrent.Executors.newDirectExecutorService; +import static org.apache.hadoop.mapreduce.lib.input.FileInputFormat.INPUT_DIR; + +/** Create MR splits by multi thread for hive partitions. */ Review comment: Good catch. I'd like to fix 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [flink] Myracle commented on a change in pull request #17988: [FLINK-25010][Connectors/Hive] Speed up hive's createMRSplits by multi thread
Myracle commented on a change in pull request #17988: URL: https://github.com/apache/flink/pull/17988#discussion_r763586448 ## File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/MRSplitsGetter.java ## @@ -0,0 +1,140 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.connectors.hive; + +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.hive.metastore.api.StorageDescriptor; +import org.apache.hadoop.mapred.InputFormat; +import org.apache.hadoop.mapred.InputSplit; +import org.apache.hadoop.mapred.JobConf; +import org.apache.hadoop.util.ReflectionUtils; +import org.apache.hadoop.util.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import static org.apache.flink.util.concurrent.Executors.newDirectExecutorService; +import static org.apache.hadoop.mapreduce.lib.input.FileInputFormat.INPUT_DIR; + +/** Create MR splits by multi thread for hive partitions. */ +public class MRSplitsGetter implements Closeable { +private static final Logger LOG = LoggerFactory.getLogger(MRSplitsGetter.class); + +private final ExecutorService executorService; + +public MRSplitsGetter(int threadNum) { +LOG.info("Open {} thread to create hive partition splits.", threadNum); + +if (threadNum > 1) { Review comment: Another choice is to specify that the thread will be set to 1 if the configured value <= 1 in the doc and log it in the method. What do you think? -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [flink] Myracle commented on a change in pull request #17988: [FLINK-25010][Connectors/Hive] Speed up hive's createMRSplits by multi thread
Myracle commented on a change in pull request #17988: URL: https://github.com/apache/flink/pull/17988#discussion_r763583826 ## File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/ContinuousHiveSplitEnumerator.java ## @@ -93,6 +95,7 @@ public ContinuousHiveSplitEnumerator( currentReadOffset, seenPartitionsSinceOffset, tablePath, +flinkConf, Review comment: Thanks for the valuable suggestion. But I have other considerations—— flinkConf can carry more info which maybe used by other features later. In this way, we need not add params one by one in functions. What do you think? -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org