diff --git ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcOutputFormat.java ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcOutputFormat.java index 835f0e8e0b..c4c56f8477 100644 --- ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcOutputFormat.java +++ ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcOutputFormat.java @@ -24,6 +24,7 @@ import java.util.List; import java.util.Properties; +import org.apache.hadoop.hive.metastore.conf.MetastoreConf; import org.apache.orc.CompressionKind; import org.apache.orc.TypeDescription; import org.slf4j.Logger; @@ -288,9 +289,11 @@ public RecordUpdater getRecordUpdater(Path path, if (!options.isWritingBase()) { opts.bufferSize(OrcRecordUpdater.DELTA_BUFFER_SIZE) .stripeSize(OrcRecordUpdater.DELTA_STRIPE_SIZE) - .blockPadding(false) - .compress(CompressionKind.NONE) - .rowIndexStride(0); + .blockPadding(false); + if(!MetastoreConf.getBoolVar(options.getConfiguration(), + MetastoreConf.ConfVars.COMPACTOR_MINOR_STATS_COMPRESSION)) { + opts.compress(CompressionKind.NONE).rowIndexStride(0); + } } final OrcRecordUpdater.KeyIndexBuilder watcher = new OrcRecordUpdater.KeyIndexBuilder("compactor"); diff --git standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java index 30ea7f8129..946f644746 100644 --- standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java +++ standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java @@ -392,6 +392,10 @@ public static ConfVars getMetaConf(String name) { "tables or partitions to be compacted once they are determined to need compaction.\n" + "It will also increase the background load on the Hadoop cluster as more MapReduce jobs\n" + "will be running in the background."), + COMPACTOR_MINOR_STATS_COMPRESSION( + "metastore.compactor.enable.stats.compression", + "metastore.compactor.enable.stats.compression", true, + "Can be used to disable compression and ORC indexes for files produced by minor compaction."), CONNECTION_DRIVER("javax.jdo.option.ConnectionDriverName", "javax.jdo.option.ConnectionDriverName", "org.apache.derby.jdbc.EmbeddedDriver", "Driver class name for a JDBC metastore"),