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/24 13:10:02 UTC

[impala] 01/02: Add default value to switch in kudu-util

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

commit 8911b73a367c7e598d4808a5799197ab68c8cd54
Author: Attila Bukor <ab...@apache.org>
AuthorDate: Tue Jul 23 22:52:02 2019 +0200

    Add default value to switch in kudu-util
    
    KuduDataTypeToColumnType in kudu-util.cc has a switch that translates
    kudu::client::KuduColumnSchema::DataType to PrimitiveType. It returns
    PrimitiveType::INVALID_TYPE if an invalid type is passed, but it was
    done after the switch instead of the 'default' case which leads to a
    warning if a new unhandled Kudu type is added to the header.
    
    Change-Id: I81a8ab4b912d443582c8ac3899f370a4b838e934
    Reviewed-on: http://gerrit.cloudera.org:8080/13901
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/exec/kudu-util.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/be/src/exec/kudu-util.cc b/be/src/exec/kudu-util.cc
index 1751322..ef5bddd 100644
--- a/be/src/exec/kudu-util.cc
+++ b/be/src/exec/kudu-util.cc
@@ -225,8 +225,8 @@ ColumnType KuduDataTypeToColumnType(
     case DataType::DECIMAL:
       return ColumnType::CreateDecimalType(
           type_attributes.precision(), type_attributes.scale());
+    default: return ColumnType(PrimitiveType::INVALID_TYPE);
   }
-  return ColumnType(PrimitiveType::INVALID_TYPE);
 }
 
 Status CreateKuduValue(const ColumnType& col_type, void* value, KuduValue** out) {