You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by st...@apache.org on 2021/09/23 07:07:00 UTC

[impala] 01/02: IMPALA-10922: Fix wrong sarg on ORC Date column in release build

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

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

commit 851fe2f6c0059de72526677b238866f201de6658
Author: stiga-huang <hu...@gmail.com>
AuthorDate: Wed Sep 22 10:09:01 2021 +0800

    IMPALA-10922: Fix wrong sarg on ORC Date column in release build
    
    One line of code is wrapped with DCHECK in generating ORC Date type
    literal for predicate pushdown. Release build will ignore all codes
    wrapped in DCHECK so that line of logic is missing. This patch fixes it
    by moving the code outside of DCHECK.
    
    Tests:
     - Reproduced the issue and verified the fix in release build.
    
    Change-Id: Ieda467c822cf5c6f0edc0ddfe4da61c46b04e51f
    Reviewed-on: http://gerrit.cloudera.org:8080/17861
    Reviewed-by: Qifan Chen <qc...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/exec/hdfs-orc-scanner.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/be/src/exec/hdfs-orc-scanner.cc b/be/src/exec/hdfs-orc-scanner.cc
index ed86477..e6647cd 100644
--- a/be/src/exec/hdfs-orc-scanner.cc
+++ b/be/src/exec/hdfs-orc-scanner.cc
@@ -987,7 +987,8 @@ orc::Literal HdfsOrcScanner::GetSearchArgumentLiteral(ScalarExprEvaluator* eval,
       const DateValue* dv = reinterpret_cast<const DateValue*>(val);
       int32_t value = 0;
       // The date should be valid at this point.
-      DCHECK(dv->ToDaysSinceEpoch(&value));
+      bool success = dv->ToDaysSinceEpoch(&value);
+      DCHECK(success);
       return orc::Literal(*predicate_type, value);
     }
     case TYPE_STRING: {