HadoopInputFormat extends HadoopInputFormatBase<K, V, Tuple2<K,V>> implements ResultTypeQueryable<Tuple2<K,V>> { @Override public TypeInformation<Tuple2<K,V>> getProducedType() { return new TupleTypeInfo<>(TypeExtractor.createTypeInfo(keyClass), TypeExtractor.createTypeInfo(valueClass)); } HadoopInputFormat(org.apache.hadoop.mapred.InputFormat<K,V> mapredInputFormat, Class<K> key, Class<V> value, JobConf job);  HadoopInputFormat(org.apache.hadoop.mapred.InputFormat<K,V> mapredInputFormat, Class<K> key, Class<V> value); @Override Tuple2<K, V> nextRecord(Tuple2<K, V> record); @Override TypeInformation<Tuple2<K,V>> getProducedType();  }
@Test public void checkTypeInformation() { try { HadoopInputFormat<Void, Long> hadoopInputFormat = new HadoopInputFormat<Void, Long>( new DummyVoidKeyInputFormat<Long>(), Void.class, Long.class, new JobConf()); TypeInformation<Tuple2<Void,Long>> tupleType = hadoopInputFormat.getProducedType(); TypeInformation<Tuple2<Void,Long>> testTupleType = new TupleTypeInfo<Tuple2<Void,Long>>(BasicTypeInfo.VOID_TYPE_INFO, BasicTypeInfo.LONG_TYPE_INFO); if(tupleType.isTupleType()) { if(!((TupleTypeInfo<?>)tupleType).equals(testTupleType)) { fail("Tuple type information was not set correctly!"); } } else { fail("Type information was not set to tuple type information!"); } } catch (Exception ex) { fail("Test failed due to a " + ex.getClass().getSimpleName() + ": " + ex.getMessage()); } }