xiaokang commented on code in PR #29297:
URL: https://github.com/apache/doris/pull/29297#discussion_r1440334974


##########
be/src/vec/columns/column_array.cpp:
##########
@@ -254,6 +254,27 @@ StringRef ColumnArray::serialize_value_into_arena(size_t 
n, Arena& arena,
     return res;
 }
 
+int ColumnArray::compare_at(size_t n, size_t m, const IColumn& rhs_, int 
nan_direction_hint) const {
+    // since column type is complex, we can't use this function
+    const auto& rhs = assert_cast<const ColumnArray&>(rhs_);
+
+    size_t lhs_size = size_at(n);
+    size_t rhs_size = rhs.size_at(m);
+    size_t min_size = std::min(lhs_size, rhs_size);
+    for (size_t i = 0; i < min_size; ++i) {
+        int res;
+        if (res = get_data().compare_at(offset_at(n) + i, rhs.offset_at(m) + 
i, *rhs.data.get(),

Review Comment:
   strange style for res variable



##########
be/src/vec/columns/column_map.cpp:
##########
@@ -217,7 +217,7 @@ StringRef ColumnMap::serialize_value_into_arena(size_t n, 
Arena& arena, char con
 
 const char* ColumnMap::deserialize_and_insert_from_arena(const char* pos) {
     size_t array_size = unaligned_load<size_t>(pos);
-    pos += 2 * sizeof(array_size);
+    pos += sizeof(array_size);

Review Comment:
   another bugfix?



##########
be/src/vec/columns/column.h:
##########
@@ -453,6 +453,7 @@ class IColumn : public COW<IColumn> {
       * For example, if nan_direction_hint == -1 is used by descending 
sorting, NaNs will be at the end.
       *
       * For non Nullable and non floating point types, nan_direction_hint is 
ignored.
+      * For array/map/struct types, comparison means equal.

Review Comment:
   'comparison means equal' is not accurate.



##########
be/src/vec/columns/column_map.cpp:
##########
@@ -231,6 +231,39 @@ const char* 
ColumnMap::deserialize_and_insert_from_arena(const char* pos) {
     return pos;
 }
 
+int ColumnMap::compare_at(size_t n, size_t m, const IColumn& rhs_, int 
nan_direction_hint) const {
+    const auto& rhs = assert_cast<const ColumnMap&>(rhs_);
+
+    size_t lhs_size = size_at(n);
+    size_t rhs_size = rhs.size_at(m);
+
+    size_t lhs_offset = offset_at(n);
+    size_t rhs_offset = rhs.offset_at(m);
+
+    size_t min_size = std::min(lhs_size, rhs_size);
+
+    int a = 0;
+    if (a) {

Review Comment:
   debug code?



##########
be/src/vec/columns/column.h:
##########
@@ -453,6 +453,7 @@ class IColumn : public COW<IColumn> {
       * For example, if nan_direction_hint == -1 is used by descending 
sorting, NaNs will be at the end.
       *
       * For non Nullable and non floating point types, nan_direction_hint is 
ignored.
+      * For array/map/struct types, comparison means equal.

Review Comment:
   Do you mean none zero return code has no meaning?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to