From e02ef4a92c84fa58e5deb328d28991ea9b0b2b71 Mon Sep 17 00:00:00 2001 From: Smith Cruise Date: Mon, 4 Nov 2024 10:32:06 +0800 Subject: [PATCH] [BugFix] Cherry pick apache orc bugfix: fix return wrong result if lack of hasnull (#52555) Signed-off-by: Smith Cruise (cherry picked from commit bc3cc76d64bfbe368c04f518d8104322d6c1d8f3) --- be/src/formats/orc/apache-orc/c++/src/sargs/PredicateLeaf.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/be/src/formats/orc/apache-orc/c++/src/sargs/PredicateLeaf.cc b/be/src/formats/orc/apache-orc/c++/src/sargs/PredicateLeaf.cc index 9e7d186c6000c..75f9b2d310ffc 100644 --- a/be/src/formats/orc/apache-orc/c++/src/sargs/PredicateLeaf.cc +++ b/be/src/formats/orc/apache-orc/c++/src/sargs/PredicateLeaf.cc @@ -705,6 +705,9 @@ TruthValue PredicateLeaf::evaluate(const WriterVersion writerVersion, const prot } } + // files written by trino may lack of hasnull field. + if (!colStats.has_hasnull()) return TruthValue::YES_NO_NULL; + bool allNull = colStats.hasnull() && colStats.numberofvalues() == 0; if (mOperator == Operator::IS_NULL || ((mOperator == Operator::EQUALS || mOperator == Operator::NULL_SAFE_EQUALS) && mLiterals.at(0).isNull())) {