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 2022/05/16 11:43:31 UTC

[GitHub] [incubator-doris] zenoyang commented on a diff in pull request #9586: [fix](storage) low_cardinality_optimize core dump when is null predicate

zenoyang commented on code in PR #9586:
URL: https://github.com/apache/incubator-doris/pull/9586#discussion_r873475614


##########
be/src/vec/columns/column_dictionary.h:
##########
@@ -98,12 +98,14 @@ class ColumnDictionary final : public COWHelper<IColumn, ColumnDictionary<T>> {
     }
 
     void insert_data(const char* pos, size_t /*length*/) override {
-        _codes.push_back(unaligned_load<T>(pos));
+        if (pos == nullptr) {
+            _codes.push_back(_dict.get_null_code());
+            return;
+        }
+        LOG(FATAL) << "insert_data not supported in ColumnDictionary";

Review Comment:
   done



##########
be/src/vec/columns/column_dictionary.h:
##########
@@ -98,12 +98,14 @@ class ColumnDictionary final : public COWHelper<IColumn, ColumnDictionary<T>> {
     }
 
     void insert_data(const char* pos, size_t /*length*/) override {
-        _codes.push_back(unaligned_load<T>(pos));
+        if (pos == nullptr) {

Review Comment:
   This function in ColumnDict is not actually called. This is just to limit handling only null.



##########
be/src/vec/columns/column_dictionary.h:
##########
@@ -304,10 +310,14 @@ class ColumnDictionary final : public COWHelper<IColumn, ColumnDictionary<T>> {
             return -1;
         }
 
+        T get_null_code() {
+            return _dict_data.size() - 1; // The last dict value is null value
+        }

Review Comment:
   No problem, if there is null, the predicate evaluates to: `bool ret = !null_bitmap[idx] && (cell_value OP dict_code);`
   `null_bitmap` will filter out null.



-- 
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