vvysotskyi commented on a change in pull request #1799: DRILL-7251: Read Hive array w/o nulls URL: https://github.com/apache/drill/pull/1799#discussion_r289420813
########## File path: contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/readers/ReadersInitializer.java ########## @@ -0,0 +1,122 @@ +/* + * 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.drill.exec.store.hive.readers; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import org.apache.drill.common.expression.SchemaPath; +import org.apache.drill.exec.ops.ExecutorFragmentContext; +import org.apache.drill.exec.ops.FragmentContext; +import org.apache.drill.exec.store.RecordReader; +import org.apache.drill.exec.store.hive.HivePartition; +import org.apache.drill.exec.store.hive.HiveSubScan; +import org.apache.drill.exec.store.hive.HiveTableWithColumnCache; +import org.apache.drill.exec.util.ImpersonationUtil; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.mapred.InputSplit; +import org.apache.hadoop.mapred.TextInputFormat; +import org.apache.hadoop.security.UserGroupInformation; + +/** + * Factory for creation of Hive record readers used by {@link org.apache.drill.exec.store.hive.HiveScanBatchCreator}. + */ +public class ReadersInitializer { + + private static final String TEXT_FORMAT = TextInputFormat.class.getCanonicalName(); + + /** + * Selects reader constructor reference as {@link HiveReaderFactory} readerFactory. + * Then check if input splits are empty creates empty record reader, or one reader per split otherwise. + * + * @param ctx context related to fragment + * @param config context which holds different Hive configurations + * @return one or more readers Review comment: List with one or more readers ---------------------------------------------------------------- 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
