pvary commented on a change in pull request #3242: URL: https://github.com/apache/iceberg/pull/3242#discussion_r734793467
########## File path: mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergInputFormat.java ########## @@ -0,0 +1,136 @@ +/* + * 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.iceberg.mr.hive; + +import java.io.IOException; +import java.util.Arrays; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.ql.exec.Utilities; +import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatchCtx; +import org.apache.hadoop.mapred.InputSplit; +import org.apache.hadoop.mapred.JobConf; +import org.apache.hadoop.mapred.RecordReader; +import org.apache.hadoop.mapred.Reporter; +import org.apache.iceberg.CombinedScanTask; +import org.apache.iceberg.FileScanTask; +import org.apache.iceberg.Table; +import org.apache.iceberg.data.Record; +import org.apache.iceberg.mr.InputFormatConfig; +import org.apache.iceberg.mr.mapred.Container; +import org.apache.iceberg.mr.mapreduce.IcebergSplit; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.mockito.MockedStatic; +import org.mockito.Mockito; + +public class TestHiveIcebergInputFormat { + + public static final String NON_VECTORIZED = "non-vectorized"; + public static final String VECTORIZED = "vectorized"; + + @Rule + public TemporaryFolder tmp = new TemporaryFolder(); + + private class HiveIcebergInputFormatTest extends HiveIcebergInputFormat { + + private String recordReaderType = ""; + + public String getRecordReaderType() { + return recordReaderType; + } + + @Override + protected void checkHive3Present() { + // Disable check for testing + } + + @Override + protected RecordReader<Void, Container<Record>> getVectorizedRecordReader(IcebergSplit icebergSplit, + JobConf job, + Reporter reporter) { + recordReaderType = VECTORIZED; + return null; + } + + @Override + protected RecordReader<Void, Container<Record>> getNonVectorizedRecordReader(InputSplit inputSplit, + JobConf job, Review comment: Nit: seems like an indentation problem. In these long methods I usually prefer to use only one line break, and 4 spaces padding. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
