You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "jacktengg (via GitHub)" <gi...@apache.org> on 2023/06/07 14:52:22 UTC

[GitHub] [doris] jacktengg opened a new pull request, #20564: [fix](case expr) fix coredump of case for null value

jacktengg opened a new pull request, #20564:
URL: https://github.com/apache/doris/pull/20564

   ## Proposed changes
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   ## Further comments
   
   be coredump when when expr is null:
   ```
   #0  0x00007fff0552337f in raise () from /lib64/libc.so.6
   #1  0x00007fff0550ddb5 in abort () from /lib64/libc.so.6
   #2  0x000055558b042039 in ?? ()
   #3  0x000055558b03764d in google::LogMessage::Fail() ()
   #4  0x000055558b039b89 in google::LogMessage::SendToLog() ()
   #5  0x000055558b0371b6 in google::LogMessage::Flush() ()
   #6  0x000055558b03a1f9 in google::LogMessageFatal::~LogMessageFatal() ()
   #7  0x000055556b2f74b1 in assert_cast<doris::vectorized::ColumnVector<unsigned char> const&, doris::vectorized::IColumn const&> (from=...)
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/common/assert_cast.h:57
   #8  0x000055556c6569d4 in doris::vectorized::ColumnVector<unsigned char>::compare_at (this=0x6040017ab450, n=0, m=0, rhs_=..., nan_direction_hint=-1)
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/columns/column_vector.h:298
   #9  0x0000555580aa7259 in doris::vectorized::FunctionCase<true, false>::execute_impl<doris::vectorized::ColumnVector<unsigned char>, false, true> (this=0x606002eba410, data_type=..., block=..., result=21,
       column_holder=...) at /mnt/disk2/tengjianping/doris-master/be/src/vec/functions/function_case.h:228
   #10 0x0000555580aa3152 in doris::vectorized::FunctionCase<true, false>::execute_get_then_null<doris::vectorized::ColumnVector<unsigned char>, false> (this=0x606002eba410, data_type=..., block=...,
       arguments=..., result=21, input_rows_count=9) at /mnt/disk2/tengjianping/doris-master/be/src/vec/functions/function_case.h:352
   #11 0x0000555580a9b0c7 in doris::vectorized::FunctionCase<true, false>::execute_get_when_null<doris::vectorized::ColumnVector<unsigned char> > (this=0x606002eba410, data_type=..., block=..., arguments=...,
       result=21, input_rows_count=9) at /mnt/disk2/tengjianping/doris-master/be/src/vec/functions/function_case.h:386
   #12 0x0000555580a99c93 in doris::vectorized::FunctionCase<true, false>::execute_get_type (this=0x606002eba410, data_type=..., block=..., arguments=..., result=21, input_rows_count=9)
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/functions/function_case.h:402
   #13 0x0000555580a9981c in doris::vectorized::FunctionCase<true, false>::execute_impl (this=0x606002eba410, context=0x612000b15740, block=..., arguments=..., result=21, input_rows_count=9)
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/functions/function_case.h:409
   #14 0x000055557dd252f6 in doris::vectorized::DefaultExecutable::execute_impl (this=0x6040017ab2e0, context=0x612000b15740, block=..., arguments=..., result=21, input_rows_count=9)
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/functions/function.h:485
   #15 0x0000555580949a83 in doris::vectorized::PreparedFunctionImpl::_execute_skipped_constant_deal (this=0x6040017ab2e0, context=0x612000b15740, block=..., args=..., result=21, input_rows_count=9,
       dry_run=false) at /mnt/disk2/tengjianping/doris-master/be/src/vec/functions/function.cpp:151
   #16 0x0000555580942381 in doris::vectorized::PreparedFunctionImpl::execute_without_low_cardinality_columns (this=0x6040017ab2e0, context=0x612000b15740, block=..., args=..., result=21, input_rows_count=9,
       dry_run=false) at /mnt/disk2/tengjianping/doris-master/be/src/vec/functions/function.cpp:262
   #17 0x00005555809424a0 in doris::vectorized::PreparedFunctionImpl::execute (this=0x6040017ab2e0, context=0x612000b15740, block=..., args=..., result=21, input_rows_count=9, dry_run=false)
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/functions/function.cpp:268
   #18 0x000055557dd21f1b in doris::vectorized::IFunctionBase::execute (this=0x6070019b1be0, context=0x612000b15740, block=..., arguments=..., result=21, input_rows_count=9, dry_run=false)
   --Type <RET> for more, q to quit, c to continue without paging--
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/functions/function.h:171
   #19 0x000055557dd971d0 in doris::vectorized::VCaseExpr::execute (this=0x61a00122be90, context=0x60700030a450, block=0x7ee025eff440, result_column_id=0x7ee025eaef90)
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/exprs/vcase_expr.cpp:105
   #20 0x000055557dd2ec62 in doris::vectorized::VExprContext::execute (this=0x60700030a450, block=0x7ee025eff440, result_column_id=0x7ee025eaef90)
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/exprs/vexpr_context.cpp:61
   #21 0x000055557dd33465 in doris::vectorized::VExprContext::execute_conjuncts (ctxs=..., filters=0x0, accept_null=false, block=0x7ee025eff440, result_filter=0x7ee025ff74d0, can_filter_all=0x7ee025ff7520)
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/exprs/vexpr_context.cpp:164
   #22 0x000055557dd31fc0 in doris::vectorized::VExprContext::execute_conjuncts_and_filter_block (ctxs=..., filters=0x0, block=0x7ee025eff440, columns_to_filter=..., column_to_keep=3)
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/exprs/vexpr_context.cpp:236
   #23 0x000055557dd31a52 in doris::vectorized::VExprContext::filter_block (expr_contexts=..., block=0x7ee025eff440, column_to_keep=3)
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/exprs/vexpr_context.cpp:144
   #24 0x000055557acca3fe in doris::vectorized::VNestedLoopJoinNode::pull (this=0x61a00123ae80, state=0x61e00239f480, block=0x60d001e22660, eos=0x7ee025eaa540)
       at /mnt/disk2/tengjianping/doris-master/be/src/vec/exec/join/vnested_loop_join_node.cpp:653
   ```
   
   


-- 
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] [doris] github-actions[bot] commented on pull request #20564: [fix](case expr) fix coredump of case for null value

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20564:
URL: https://github.com/apache/doris/pull/20564#issuecomment-1580996255

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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] [doris] jacktengg commented on pull request #20564: [fix](case expr) fix coredump of case for null value

Posted by "jacktengg (via GitHub)" <gi...@apache.org>.
jacktengg commented on PR #20564:
URL: https://github.com/apache/doris/pull/20564#issuecomment-1580991883

   run buildall


-- 
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] [doris] jacktengg commented on pull request #20564: [fix](case expr) fix coredump of case for null value

Posted by "jacktengg (via GitHub)" <gi...@apache.org>.
jacktengg commented on PR #20564:
URL: https://github.com/apache/doris/pull/20564#issuecomment-1581799907

   run buildall


-- 
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] [doris] github-actions[bot] commented on pull request #20564: [fix](case expr) fix coredump of case for null value

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20564:
URL: https://github.com/apache/doris/pull/20564#issuecomment-1581778402

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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] [doris] github-actions[bot] commented on pull request #20564: [fix](case expr) fix coredump of case for null value

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20564:
URL: https://github.com/apache/doris/pull/20564#issuecomment-1581801128

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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] [doris] jacktengg commented on a diff in pull request #20564: [fix](case expr) fix coredump of case for null value

Posted by "jacktengg (via GitHub)" <gi...@apache.org>.
jacktengg commented on code in PR #20564:
URL: https://github.com/apache/doris/pull/20564#discussion_r1222940741


##########
be/src/vec/functions/function_case.h:
##########
@@ -332,13 +332,13 @@ class FunctionCase : public IFunction {
         bool then_null = false;
         for (int i = 1 + has_case; i < arguments.size() - has_else; i += 2) {
             auto then_column_ptr = block.get_by_position(arguments[i]).column;
-            if (then_column_ptr->is_nullable()) {
+            if (then_column_ptr->is_nullable() || then_column_ptr->only_null()) {
                 then_null = true;
             }
         }
         if constexpr (has_else) {
             auto else_column_ptr = block.get_by_position(arguments[arguments.size() - 1]).column;
-            if (else_column_ptr->is_nullable()) {
+            if (else_column_ptr->is_nullable() || else_column_ptr->only_null()) {

Review Comment:
   Change column_const's is_nullable will impact many existing code, e.g. casting column to ColumnNullable 
   
   ```
   template <PrimitiveType T>
   uint16_t BitmapFilterColumnPredicate<T>::evaluate(const vectorized::IColumn& column, uint16_t* sel,
                                                     uint16_t size) const {
       if (column.is_nullable()) {
           auto* nullable_col = reinterpret_cast<const vectorized::ColumnNullable*>(&column);
       }
   ```



-- 
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] [doris] jacktengg commented on pull request #20564: [fix](case expr) fix coredump of case for null value

Posted by "jacktengg (via GitHub)" <gi...@apache.org>.
jacktengg commented on PR #20564:
URL: https://github.com/apache/doris/pull/20564#issuecomment-1581789497

   run buildall


-- 
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] [doris] github-actions[bot] commented on pull request #20564: [fix](case expr) fix coredump of case for null value

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20564:
URL: https://github.com/apache/doris/pull/20564#issuecomment-1581798995

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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] [doris] BiteTheDDDDt merged pull request #20564: [fix](case expr) fix coredump of case for null value

Posted by "BiteTheDDDDt (via GitHub)" <gi...@apache.org>.
BiteTheDDDDt merged PR #20564:
URL: https://github.com/apache/doris/pull/20564


-- 
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] [doris] BiteTheDDDDt commented on a diff in pull request #20564: [fix](case expr) fix coredump of case for null value

Posted by "BiteTheDDDDt (via GitHub)" <gi...@apache.org>.
BiteTheDDDDt commented on code in PR #20564:
URL: https://github.com/apache/doris/pull/20564#discussion_r1222869921


##########
be/src/vec/functions/function_case.h:
##########
@@ -332,13 +332,13 @@ class FunctionCase : public IFunction {
         bool then_null = false;
         for (int i = 1 + has_case; i < arguments.size() - has_else; i += 2) {
             auto then_column_ptr = block.get_by_position(arguments[i]).column;
-            if (then_column_ptr->is_nullable()) {
+            if (then_column_ptr->is_nullable() || then_column_ptr->only_null()) {
                 then_null = true;
             }
         }
         if constexpr (has_else) {
             auto else_column_ptr = block.get_by_position(arguments[arguments.size() - 1]).column;
-            if (else_column_ptr->is_nullable()) {
+            if (else_column_ptr->is_nullable() || else_column_ptr->only_null()) {

Review Comment:
   why not change column_const's is_nullable?



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