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/04 03:35:03 UTC

[GitHub] [incubator-doris] HappenLee opened a new pull request, #9360: [Bug][stream-vec-load] Null data load do not skip the same place data

HappenLee opened a new pull request, #9360:
URL: https://github.com/apache/incubator-doris/pull/9360

   # Proposed changes
   
   Issue Number: close #9355
   
   ## Problem Summary:
   
   Describe the overview of changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (Yes)
   2. Has unit tests been added: (Yes)
   3. Has document been added or modified: (No Need)
   4. Does it need to update dependencies: (No)
   5. Are there any changes that cannot be rolled back: (Yes)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   


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


[GitHub] [incubator-doris] wangbo merged pull request #9360: [Bug][stream-vec-load] Null data load do not skip the same place data

Posted by GitBox <gi...@apache.org>.
wangbo merged PR #9360:
URL: https://github.com/apache/incubator-doris/pull/9360


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


[GitHub] [incubator-doris] Gabriel39 commented on pull request #9360: [Bug][stream-vec-load] Null data load do not skip the same place data

Posted by GitBox <gi...@apache.org>.
Gabriel39 commented on PR #9360:
URL: https://github.com/apache/incubator-doris/pull/9360#issuecomment-1118084799

   LGTM


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


[GitHub] [incubator-doris] spaces-X commented on pull request #9360: [Bug][stream-vec-load] Null data load do not skip the same place data

Posted by GitBox <gi...@apache.org>.
spaces-X commented on PR #9360:
URL: https://github.com/apache/incubator-doris/pull/9360#issuecomment-1119279838

   LGTM


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


[GitHub] [incubator-doris] Gabriel39 commented on a diff in pull request #9360: [Bug][stream-vec-load] Null data load do not skip the same place data

Posted by GitBox <gi...@apache.org>.
Gabriel39 commented on code in PR #9360:
URL: https://github.com/apache/incubator-doris/pull/9360#discussion_r864555181


##########
be/src/olap/rowset/segment_v2/column_writer.cpp:
##########
@@ -193,23 +193,43 @@ Status ColumnWriter::append_nullable(const uint8_t* is_null_bits, const void* da
     return Status::OK();
 }
 
+Status ColumnWriter::append_nullable(const uint8_t* null_map, const uint8_t** ptr,
+                                     size_t num_rows) {
+    size_t offset = 0;
+    auto next_run_step = [&]() {
+        size_t step = 1;
+        for (auto i = offset + 1; i < num_rows; ++i) {
+            if (null_map[offset] == null_map[i])
+                step++;
+            else
+                break;
+        }
+        return step;
+    };
+
+    do {
+        auto step = next_run_step();
+        if (null_map[offset]) {
+            RETURN_IF_ERROR(append_nulls(step));
+            *ptr += get_field()->size() * step;
+        } else {
+            // TODO:
+            //  1. `*ptr += get_field()->size() * step;` should do in this function, not append_data;
+            //  2. support array vectorized load and ptr offset add
+            RETURN_IF_ERROR(append_data(ptr, step));
+        }
+        offset += step;
+    } while (offset < num_rows);
+
+    return Status::OK();
+}
+
 Status ColumnWriter::append(const uint8_t* nullmap, const void* data, size_t num_rows) {
     assert(data && num_rows > 0);
+    const auto* ptr = (const uint8_t*)data;
     if (nullmap) {
-        size_t bitmap_size = BitmapSize(num_rows);
-        if (_null_bitmap.size() < bitmap_size) {

Review Comment:
   `_null_bitmap` is not used after this PR. We should remove this variable from ColumnWriter



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


[GitHub] [incubator-doris] HappenLee commented on a diff in pull request #9360: [Bug][stream-vec-load] Null data load do not skip the same place data

Posted by GitBox <gi...@apache.org>.
HappenLee commented on code in PR #9360:
URL: https://github.com/apache/incubator-doris/pull/9360#discussion_r864816378


##########
be/src/olap/rowset/segment_v2/column_writer.cpp:
##########
@@ -193,23 +193,43 @@ Status ColumnWriter::append_nullable(const uint8_t* is_null_bits, const void* da
     return Status::OK();
 }
 
+Status ColumnWriter::append_nullable(const uint8_t* null_map, const uint8_t** ptr,
+                                     size_t num_rows) {
+    size_t offset = 0;
+    auto next_run_step = [&]() {
+        size_t step = 1;
+        for (auto i = offset + 1; i < num_rows; ++i) {
+            if (null_map[offset] == null_map[i])
+                step++;
+            else
+                break;
+        }
+        return step;
+    };
+
+    do {
+        auto step = next_run_step();
+        if (null_map[offset]) {
+            RETURN_IF_ERROR(append_nulls(step));
+            *ptr += get_field()->size() * step;
+        } else {
+            // TODO:
+            //  1. `*ptr += get_field()->size() * step;` should do in this function, not append_data;
+            //  2. support array vectorized load and ptr offset add
+            RETURN_IF_ERROR(append_data(ptr, step));
+        }
+        offset += step;
+    } while (offset < num_rows);
+
+    return Status::OK();
+}
+
 Status ColumnWriter::append(const uint8_t* nullmap, const void* data, size_t num_rows) {
     assert(data && num_rows > 0);
+    const auto* ptr = (const uint8_t*)data;
     if (nullmap) {
-        size_t bitmap_size = BitmapSize(num_rows);
-        if (_null_bitmap.size() < bitmap_size) {

Review Comment:
   the not vectorized load still use `_null_bitmap`, we will remove it after replace the old load way



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