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/08 12:00:16 UTC

[GitHub] [doris] jacktengg commented on a diff in pull request #20564: [fix](case expr) fix coredump of case for null value

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