From 30ae5af59894a6a290d714b6ad0f090419054279 Mon Sep 17 00:00:00 2001 From: deshanxiao Date: Tue, 10 Jan 2023 03:04:46 -0800 Subject: [PATCH] ORC-1343: Disable ENABLE_INDEXES ### What changes were proposed in this pull request? This is a partial revert of ORC-1283. ### Why are the changes needed? ORC reader assumes built-in indexes always so far. ### How was this patch tested? N/A Closes #1372 from dongjoon-hyun/ORC-1343-1.8. Authored-by: deshanxiao Signed-off-by: Dongjoon Hyun --- java/core/src/java/org/apache/orc/impl/WriterImpl.java | 3 ++- java/core/src/test/org/apache/orc/impl/TestWriterImpl.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/java/core/src/java/org/apache/orc/impl/WriterImpl.java b/java/core/src/java/org/apache/orc/impl/WriterImpl.java index e328d77937..264b01a3f4 100644 --- a/java/core/src/java/org/apache/orc/impl/WriterImpl.java +++ b/java/core/src/java/org/apache/orc/impl/WriterImpl.java @@ -189,7 +189,8 @@ public WriterImpl(FileSystem fs, this.rowIndexStride = 0; } - this.buildIndex = opts.isBuildIndex() && (rowIndexStride > 0); + // ORC-1343: We ignore `opts.isBuildIndex` due to the lack of reader support + this.buildIndex = rowIndexStride > 0; if (buildIndex && rowIndexStride < MIN_ROW_INDEX_STRIDE) { throw new IllegalArgumentException("Row stride must be at least " + MIN_ROW_INDEX_STRIDE); diff --git a/java/core/src/test/org/apache/orc/impl/TestWriterImpl.java b/java/core/src/test/org/apache/orc/impl/TestWriterImpl.java index 84f4df8087..679fb6cb88 100644 --- a/java/core/src/test/org/apache/orc/impl/TestWriterImpl.java +++ b/java/core/src/test/org/apache/orc/impl/TestWriterImpl.java @@ -32,6 +32,7 @@ import org.apache.orc.*; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -93,6 +94,7 @@ public void testNoBFIfNoIndex() throws Exception { w.close(); } + @Disabled("ORC-1343: Disable ENABLE_INDEXES tests until reader supports it properly") @Test public void testNoIndexIfEnableIndexIsFalse() throws Exception { conf.set(OrcConf.OVERWRITE_OUTPUT_FILE.getAttribute(), "true");