You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2019/08/04 12:32:16 UTC

[GitHub] [incubator-doris] imay commented on a change in pull request #1574: Support multi partition column when creating table

imay commented on a change in pull request #1574:  Support multi partition column when creating table
URL: https://github.com/apache/incubator-doris/pull/1574#discussion_r310384428
 
 

 ##########
 File path: be/src/exec/tablet_info.h
 ##########
 @@ -114,16 +115,23 @@ class OlapTablePartKeyComparator {
             return true;
         }
 
-        bool lhs_null = lhs->is_null(_slot_desc->null_indicator_offset());
-        bool rhs_null = rhs->is_null(_slot_desc->null_indicator_offset());
-        if (lhs_null || rhs_null) { return !rhs_null; }
-
-        auto lhs_value = lhs->get_slot(_slot_desc->tuple_offset());
-        auto rhs_value = rhs->get_slot(_slot_desc->tuple_offset());
-        return RawValue::lt(lhs_value, rhs_value, _slot_desc->type());
+        for (auto slot_desc : _slot_descs) {
+            bool lhs_null = lhs->is_null(slot_desc->null_indicator_offset());
+            bool rhs_null = rhs->is_null(slot_desc->null_indicator_offset());
+            if (lhs_null && rhs_null) { continue; }
+            if (lhs_null || rhs_null) { return !rhs_null; }
+
+            auto lhs_value = lhs->get_slot(slot_desc->tuple_offset());
+            auto rhs_value = rhs->get_slot(slot_desc->tuple_offset());
+            
+            int res = RawValue::compare(lhs_value, rhs_value, slot_desc->type());
+            if (res != 0) { return res == -1; }
 
 Review comment:
   ```suggestion
               if (res != 0) { return res < 0; }
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org