OrcRowInputFormat extends FileInputFormat<Row> implements ResultTypeQueryable<Row> { public void selectFields(int... selectedFields) { this.selectedFields = selectedFields; this.rowType = RowTypeInfo.projectFields(this.rowType, selectedFields); } OrcRowInputFormat(String path, String schemaString, Configuration orcConfig);  OrcRowInputFormat(String path, String schemaString, Configuration orcConfig, int batchSize);  OrcRowInputFormat(String path, TypeDescription orcSchema, Configuration orcConfig, int batchSize); void addPredicate(Predicate predicate); void selectFields(int... selectedFields); @Override void openInputFormat(); @Override void open(FileInputSplit fileSplit); @Override void close(); @Override void closeInputFormat(); @Override boolean reachedEnd(); @Override Row nextRecord(Row reuse); @Override TypeInformation<Row> getProducedType();  }
@Test(expected = IndexOutOfBoundsException.class) public void testInvalidProjection1() throws IOException{ rowOrcInputFormat = new OrcRowInputFormat(getPath(TEST_FILE_FLAT), TEST_SCHEMA_FLAT, new Configuration()); int[] projectionMask = {1, 2, 3, -1}; rowOrcInputFormat.selectFields(projectionMask); }
@Test(expected = IndexOutOfBoundsException.class) public void testInvalidProjection2() throws IOException{ rowOrcInputFormat = new OrcRowInputFormat(getPath(TEST_FILE_FLAT), TEST_SCHEMA_FLAT, new Configuration()); int[] projectionMask = {1, 2, 3, 9}; rowOrcInputFormat.selectFields(projectionMask); }