You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/11/19 02:33:24 UTC

[GitHub] [incubator-doris] xinghuayu007 commented on a change in pull request #7149: [Feature] Z-Order Implement

xinghuayu007 commented on a change in pull request #7149:
URL: https://github.com/apache/incubator-doris/pull/7149#discussion_r752819893



##########
File path: be/src/util/tuple_row_zorder_compare.h
##########
@@ -0,0 +1,70 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef DORIS_TUPLE_ROW_ZORDER_COMPARE_H
+#define DORIS_TUPLE_ROW_ZORDER_COMPARE_H
+
+#include "exec/sort_exec_exprs.h"
+#include "exprs/expr.h"
+#include "exprs/expr_context.h"
+#include "runtime/descriptors.h"
+#include "runtime/raw_value.h"
+#include "runtime/tuple.h"
+#include "runtime/tuple_row.h"
+#include "olap/schema.h"
+#include "olap/row.h"
+#include "olap/row_cursor.h"
+
+namespace doris {
+class RowComparator {
+public:
+    RowComparator()=default;
+    RowComparator(Schema* schema);
+    virtual int operator()(const char* left, const char* right) const;
+};
+
+class TupleRowZOrderComparator: public RowComparator {
+
+    private:

Review comment:
       done

##########
File path: be/src/util/tuple_row_zorder_compare.h
##########
@@ -0,0 +1,70 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef DORIS_TUPLE_ROW_ZORDER_COMPARE_H
+#define DORIS_TUPLE_ROW_ZORDER_COMPARE_H
+
+#include "exec/sort_exec_exprs.h"
+#include "exprs/expr.h"
+#include "exprs/expr_context.h"
+#include "runtime/descriptors.h"
+#include "runtime/raw_value.h"
+#include "runtime/tuple.h"
+#include "runtime/tuple_row.h"
+#include "olap/schema.h"
+#include "olap/row.h"
+#include "olap/row_cursor.h"
+
+namespace doris {
+class RowComparator {
+public:
+    RowComparator()=default;
+    RowComparator(Schema* schema);
+    virtual int operator()(const char* left, const char* right) const;
+};
+
+class TupleRowZOrderComparator: public RowComparator {
+
+    private:
+        typedef __uint128_t uint128_t;
+        int _max_col_size = 0;
+        const Schema* _schema;
+        int _sort_col_num = 0;
+
+    public:

Review comment:
       done

##########
File path: be/src/olap/skiplist.h
##########
@@ -277,7 +277,7 @@ int SkipList<Key, Comparator>::RandomHeight() {
 template <typename Key, class Comparator>
 bool SkipList<Key, Comparator>::KeyIsAfterNode(const Key& key, Node* n) const {
     // nullptr n is considered infinite
-    return (n != nullptr) && (compare_(n->key, key) < 0);
+    return (n != NULL) && ((*compare_)(n->key, key) < 0);

Review comment:
       done




-- 
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-unsubscribe@doris.apache.org

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



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