You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by cs...@apache.org on 2019/07/31 11:13:29 UTC

[impala] branch master updated: IMPALA-8810: Fix ExplainTest when Orc support is disabled

This is an automated email from the ASF dual-hosted git repository.

csringhofer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new ffb78e2  IMPALA-8810: Fix ExplainTest when Orc support is disabled
ffb78e2 is described below

commit ffb78e24d91fadd3ffb79692211a6208a9eaedf1
Author: Csaba Ringhofer <cs...@cloudera.com>
AuthorDate: Tue Jul 30 21:29:04 2019 +0200

    IMPALA-8810: Fix ExplainTest when Orc support is disabled
    
    The problem was that ExplainTest only mocks
    HdfsPartition.getFileFormat() but not
    HdfsPartition.getInputFormatDescriptor(), and the latter is called
    then dereferenced during testScanNodeFsScheme() (only if Orc support
    is disabled), leading to null pointer exception.
    
    I went for the lazy solution of replacing
    getInputFormatDescriptor().getFileFormat() calls with getFileFormat().
    The other solution would have been to mock getInputFormatDescriptor()
    too, but I think that would have only added unnecessary dependencies to
    the test.
    
    Change-Id: I0d8bcb67e095a63beb9059568ba34b7fd261f233
    Reviewed-on: http://gerrit.cloudera.org:8080/13956
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 fe/src/main/java/org/apache/impala/catalog/HdfsTable.java         | 2 +-
 fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java      | 4 ++--
 fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java b/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java
index ba9738c..2bb579f 100644
--- a/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java
+++ b/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java
@@ -1776,7 +1776,7 @@ public class HdfsTable extends Table implements FeFsTable {
             p.getParameters());
         rowBuilder.add(rep.toString());
       }
-      rowBuilder.add(p.getInputFormatDescriptor().getFileFormat().toString());
+      rowBuilder.add(p.getFileFormat().toString());
       rowBuilder.add(String.valueOf(p.hasIncrementalStats()));
       rowBuilder.add(p.getLocation());
       result.addToRows(rowBuilder.get());
diff --git a/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java b/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
index a9cf603..df93e5e 100644
--- a/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
+++ b/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
@@ -470,7 +470,7 @@ public class HdfsScanNode extends ScanNode {
 
     if (!BackendConfig.INSTANCE.isOrcScannerEnabled()) {
       for (FeFsPartition part: partitions_) {
-        if (part.getInputFormatDescriptor().getFileFormat() == HdfsFileFormat.ORC) {
+        if (part.getFileFormat() == HdfsFileFormat.ORC) {
           throw new NotImplementedException(
               "ORC scans are disabled by --enable_orc_scanner flag");
         }
@@ -496,7 +496,7 @@ public class HdfsScanNode extends ScanNode {
     }
 
     for (FeFsPartition part: partitions_) {
-      HdfsFileFormat format = part.getInputFormatDescriptor().getFileFormat();
+      HdfsFileFormat format = part.getFileFormat();
       if (format.isComplexTypesSupported()) continue;
       // If the file format allows querying just scalar typed columns and the query
       // doesn't materialize any complex typed columns, it is allowed.
diff --git a/fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java b/fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java
index 9413e11..f6d6302 100644
--- a/fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java
+++ b/fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java
@@ -1273,7 +1273,7 @@ public class SingleNodePlanner {
     FeFsPartition part = findUnsupportedDateFsPartition(partitions);
     if (part != null) {
       FeFsTable table = (FeFsTable)hdfsTblRef.getTable();
-      HdfsFileFormat ff = part.getInputFormatDescriptor().getFileFormat();
+      HdfsFileFormat ff = part.getFileFormat();
       // Throw an exception if tupleDesc contains a non-clustering, materialized
       // DATE slot.
       for (SlotDescriptor slotDesc: tupleDesc.getMaterializedSlots()) {
@@ -1343,7 +1343,7 @@ public class SingleNodePlanner {
   private FeFsPartition findUnsupportedDateFsPartition(
       List<? extends FeFsPartition> partitions) {
     for (FeFsPartition part: partitions) {
-      HdfsFileFormat ff = part.getInputFormatDescriptor().getFileFormat();
+      HdfsFileFormat ff = part.getFileFormat();
       if (!ff.isDateTypeSupported()) return part;
     }
     return null;