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

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


The following commit(s) were added to refs/heads/master by this push:
     new 95260560449 [fix](vec) wrong implementation of operator <=> of Field 
(#29743)
95260560449 is described below

commit 95260560449951b04cdf61a80315689341c1dd0d
Author: Jerry Hu <[email protected]>
AuthorDate: Thu Jan 11 13:12:56 2024 +0800

    [fix](vec) wrong implementation of operator <=> of Field (#29743)
---
 be/src/vec/core/field.h        | 3 ++-
 be/src/vec/exec/vsort_node.cpp | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/be/src/vec/core/field.h b/be/src/vec/core/field.h
index 15de84589f2..5955b4d830a 100644
--- a/be/src/vec/core/field.h
+++ b/be/src/vec/core/field.h
@@ -553,7 +553,8 @@ public:
 
     std::strong_ordering operator<=>(const Field& rhs) const {
         if (which == Types::Null || rhs == Types::Null) {
-            return std::strong_ordering::equal;
+            return which == rhs.which ? std::strong_ordering::equal
+                                      : std::strong_ordering::equivalent;
         }
         if (which != rhs.which) {
             LOG(FATAL) << "lhs type not equal with rhs, lhs=" << 
Types::to_string(which)
diff --git a/be/src/vec/exec/vsort_node.cpp b/be/src/vec/exec/vsort_node.cpp
index 7fd9ac274b1..189c628ef0b 100644
--- a/be/src/vec/exec/vsort_node.cpp
+++ b/be/src/vec/exec/vsort_node.cpp
@@ -145,7 +145,7 @@ Status VSortNode::sink(RuntimeState* state, 
vectorized::Block* input_block, bool
         // update runtime predicate
         if (_use_topn_opt) {
             Field new_top = _sorter->get_top_value();
-            if (!new_top.is_null() && (old_top.is_null() || new_top != 
old_top)) {
+            if (!new_top.is_null() && new_top != old_top) {
                 auto& sort_description = _sorter->get_sort_description();
                 auto col = 
input_block->get_by_position(sort_description[0].column_number);
                 if (!col.name.empty()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to