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/19 09:35:38 UTC

[GitHub] [incubator-doris] cambyzju opened a new pull request, #9688: [bug] null value serialize to same key

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

   # Proposed changes
   
   Issue Number: close #9544
   
   ## Problem Summary:
   
   Describe the overview of changes.
   
   The reason in the issue is:
   In vec engine, if value is appended by left join, null value equals 2, it is different with normal null value(1).
   So there are two rows `NULL` after `group by`.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (Yes/No/I Don't know)
   2. Has unit tests been added: (Yes/No/No Need)
   3. Has document been added or modified: (Yes/No/No Need)
   4. Does it need to update dependencies: (Yes/No)
   5. Are there any changes that cannot be rolled back: (Yes/No)
   
   ## 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] cambyzju commented on a diff in pull request #9688: [fix] group by with two NULL rows after left join

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


##########
be/src/vec/columns/column_nullable.cpp:
##########
@@ -102,7 +102,10 @@ StringRef ColumnNullable::serialize_value_into_arena(size_t n, Arena& arena,
     static constexpr auto s = sizeof(arr[0]);
 
     auto pos = arena.alloc_continue(s, begin);
-    memcpy(pos, &arr[n], s);
+    // Value of `NULL` may be 1 or JOIN_NULL_HINT, we serialize both to 1.
+    // Because we need same key for both `NULL` values while processing `group by`.
+    UInt8* val = reinterpret_cast<UInt8*>(pos);
+    *val = (arr[n] ? 1 : 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


[GitHub] [incubator-doris] yiguolei commented on a diff in pull request #9688: [fix] group by with two NULL rows after left join

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


##########
be/src/vec/columns/column_nullable.cpp:
##########
@@ -102,7 +102,10 @@ StringRef ColumnNullable::serialize_value_into_arena(size_t n, Arena& arena,
     static constexpr auto s = sizeof(arr[0]);
 
     auto pos = arena.alloc_continue(s, begin);
-    memcpy(pos, &arr[n], s);
+    // Value of `NULL` may be 1 or JOIN_NULL_HINT, we serialize both to 1.
+    // Because we need same key for both `NULL` values while processing `group by`.
+    UInt8* val = reinterpret_cast<UInt8*>(pos);
+    *val = (arr[n] ? 1 : 0);
 

Review Comment:
   Could you please add regression test for this case?



-- 
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 merged pull request #9688: [fix] group by with two NULL rows after left join

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


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