From bcde937f527295798514feae4be340ed8c577436 Mon Sep 17 00:00:00 2001 From: Laszlo Bodor Date: Wed, 21 Jul 2021 13:56:57 +0200 Subject: [PATCH] HIVE-23889: Empty bucket files are inserted with invalid schema after HIVE-21784 --- .../org/apache/hadoop/hive/ql/io/orc/OrcRecordUpdater.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRecordUpdater.java b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRecordUpdater.java index 2e4ef315c3..ccdd81c029 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRecordUpdater.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRecordUpdater.java @@ -577,10 +577,7 @@ public void close(boolean abort) throws IOException { // With insert overwrite we need the empty file to delete the previous content of the table LOG.debug("Empty file has been created for overwrite: {}", path); - OrcFile.WriterOptions wo = OrcFile.writerOptions(this.options.getConfiguration()) - .inspector(rowInspector) - .callback(new OrcRecordUpdater.KeyIndexBuilder("testEmpty")); - OrcFile.createWriter(path, wo).close(); + OrcFile.createWriter(path, writerOptions).close(); } else { LOG.debug("No insert events in path: {}.. Deleting..", path); fs.delete(path, false); -- 2.30.1 (Apple Git-130)