diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java index 2337a350e6..878da0f2fc 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java @@ -317,7 +317,7 @@ public static RecordReader createReaderFromFile(Reader file, */ TypeDescription schema = getDesiredRowTypeDescr(conf, false, Integer.MAX_VALUE); - Reader.Options options = new Reader.Options().range(offset, length); + Reader.Options options = new Reader.Options(conf).range(offset, length); options.schema(schema); boolean isOriginal = isOriginal(file); if (schema == null) { @@ -2119,7 +2119,7 @@ public float getProgress() throws IOException { */ TypeDescription schema = OrcInputFormat.getDesiredRowTypeDescr(conf, true, Integer.MAX_VALUE); - Reader.Options readerOptions = new Reader.Options().schema(schema); + Reader.Options readerOptions = new Reader.Options(conf).schema(schema); // TODO: Convert genIncludedColumns and setSearchArgument to use TypeDescription. final List schemaTypes = OrcUtils.getOrcTypes(schema); readerOptions.include(OrcInputFormat.genIncludedColumns(schema, conf)); @@ -2371,7 +2371,7 @@ private static boolean isStripeSatisfyPredicate( mergerOptions.rootPath(deltaDirectory[0].getParent()); } return new OrcRawRecordMerger(conf, collapseEvents, null, isOriginal, - bucket, validWriteIdList, new Reader.Options(), deltaDirectory, mergerOptions); + bucket, validWriteIdList, new Reader.Options(conf), deltaDirectory, mergerOptions); } /** diff --git a/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java b/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java index b28c126dbc..ecfe785238 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java @@ -4070,4 +4070,14 @@ public void testAcidReadPastLastStripeOffset() throws Exception { reader.close(); } + + public void testCreateOptionsForReader_ReaderOptionConfiguration() throws Exception { + Configuration conf = new Configuration(); + conf.set(IOConstants.SCHEMA_EVOLUTION_COLUMNS, "col1"); + conf.set(IOConstants.SCHEMA_EVOLUTION_COLUMNS_TYPES, "string"); + + conf.set(OrcConf.FORCE_POSITIONAL_EVOLUTION.getHiveConfName(), Boolean.TRUE.toString()); + Reader.Options options = OrcInputFormat.createOptionsForReader(conf); + assertTrue(options.getForcePositionalEvolution()); + } }