gaoyunhaii commented on code in PR #20415: URL: https://github.com/apache/flink/pull/20415#discussion_r937446529
########## flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveSourceDynamicFileEnumerator.java: ########## @@ -0,0 +1,216 @@ +/* + * 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.flink.connector.file.src.FileSourceSplit; +import org.apache.flink.connector.file.src.enumerate.DynamicFileEnumerator; +import org.apache.flink.connectors.hive.util.JobConfUtils; +import org.apache.flink.core.fs.Path; +import org.apache.flink.table.connector.source.DynamicFilteringData; +import org.apache.flink.table.data.GenericRowData; +import org.apache.flink.table.data.RowData; +import org.apache.flink.table.data.StringData; +import org.apache.flink.table.data.TimestampData; +import org.apache.flink.table.types.logical.LogicalTypeFamily; +import org.apache.flink.table.types.logical.RowType; +import org.apache.flink.util.Preconditions; + +import org.apache.hadoop.mapred.JobConf; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import static org.apache.flink.table.types.logical.utils.LogicalTypeChecks.getPrecision; +import static org.apache.flink.util.Preconditions.checkNotNull; + +/** + * A {@link DynamicFileEnumerator} implementation for hive source. It uses {@link + * HiveSourceFileEnumerator#createInputSplits} to generate splits like HiveSourceFileEnumerator, but + * only enumerates {@link HiveTablePartition}s that exist in the {@link DynamicFilteringData} if a + * DynamicFilteringData is provided. + */ +public class HiveSourceDynamicFileEnumerator implements DynamicFileEnumerator { Review Comment: Might we also add a test class for this class? -- 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