pvary commented on a change in pull request #3242:
URL: https://github.com/apache/iceberg/pull/3242#discussion_r734378668



##########
File path: 
mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergInputFormat.java
##########
@@ -0,0 +1,125 @@
+/*
+ * 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.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.Schema;
+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.apache.iceberg.types.Types;
+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;
+
+import static org.apache.iceberg.types.Types.NestedField.required;
+
+public class TestHiveIcebergInputFormat {
+
+  private static final String MAPRED_ICEBEBERG_RECORD_READER_CLASS
+          = 
"org.apache.iceberg.mr.mapred.MapredIcebergInputFormat.MapredIcebergRecordReader";
+
+  private class HiveIcebergInputFormatTest extends HiveIcebergInputFormat {
+    @Override
+    protected void checkHive3Present() {
+      // Disable check for testing
+    }
+
+    @Override
+    protected RecordReader<Void, Container<Record>> 
getVectorizedRecordReader(IcebergSplit icebergSplit,
+                                                                              
JobConf job,
+                                                                              
Reporter reporter) {
+      return null;
+    }
+  }
+
+  private static final Schema schema = new Schema(required(1, "string_field", 
Types.StringType.get()));
+
+  private HiveIcebergSplit createSpit() {
+    FileScanTask fileScanTask = Mockito.mock(FileScanTask.class);
+    CombinedScanTask task = Mockito.mock(CombinedScanTask.class);
+    Mockito.when(task.files()).thenReturn(Arrays.asList(fileScanTask));
+    IcebergSplit innerSplit = Mockito.mock(IcebergSplit.class);
+    Mockito.when(innerSplit.task()).thenReturn(task);
+    Table table = Mockito.mock(Table.class);
+    Mockito.when(innerSplit.table()).thenReturn(table);
+    HiveIcebergSplit split = Mockito.mock(HiveIcebergSplit.class);
+    Mockito.when(split.icebergSplit()).thenReturn(innerSplit);
+    return split;
+  }
+
+  @Rule
+  public TemporaryFolder tmp = new TemporaryFolder();

Review comment:
       nit: Could we put this declaration before the methods




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

Reply via email to