This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 277025b046 [fix](join)ColumnNullable need handle const column with 
nullable const value (#13866)
277025b046 is described below

commit 277025b0466103977aa08c8129eecd3bfe13dc01
Author: starocean999 <[email protected]>
AuthorDate: Wed Nov 2 08:52:49 2022 +0800

    [fix](join)ColumnNullable need handle const column with nullable const 
value (#13866)
---
 be/src/vec/columns/column_nullable.cpp                    |  7 +++++++
 .../correctness_p0/test_outer_join_with_cross_join.out    |  3 +++
 .../correctness_p0/test_outer_join_with_cross_join.groovy | 15 +++++++++++++++
 3 files changed, 25 insertions(+)

diff --git a/be/src/vec/columns/column_nullable.cpp 
b/be/src/vec/columns/column_nullable.cpp
index 5328131605..de9ecae713 100644
--- a/be/src/vec/columns/column_nullable.cpp
+++ b/be/src/vec/columns/column_nullable.cpp
@@ -35,6 +35,13 @@ ColumnNullable::ColumnNullable(MutableColumnPtr&& 
nested_column_, MutableColumnP
     /// ColumnNullable cannot have constant nested column. But constant 
argument could be passed. Materialize it.
     nested_column = get_nested_column().convert_to_full_column_if_const();
 
+    // after convert const column to full column, it may be a nullable column
+    if (nested_column->is_nullable()) {
+        assert_cast<ColumnNullable&>(*nested_column).apply_null_map((const 
ColumnUInt8&)*null_map);
+        null_map = 
assert_cast<ColumnNullable&>(*nested_column).get_null_map_column_ptr();
+        nested_column = 
assert_cast<ColumnNullable&>(*nested_column).get_nested_column_ptr();
+    }
+
     if (!get_nested_column().can_be_inside_nullable()) {
         LOG(FATAL) << get_nested_column().get_name() << " cannot be inside 
Nullable column";
     }
diff --git 
a/regression-test/data/correctness_p0/test_outer_join_with_cross_join.out 
b/regression-test/data/correctness_p0/test_outer_join_with_cross_join.out
index 72d126351a..0a5825a7bb 100644
--- a/regression-test/data/correctness_p0/test_outer_join_with_cross_join.out
+++ b/regression-test/data/correctness_p0/test_outer_join_with_cross_join.out
@@ -2,3 +2,6 @@
 -- !select --
 1
 
+-- !select2 --
+1
+
diff --git 
a/regression-test/suites/correctness_p0/test_outer_join_with_cross_join.groovy 
b/regression-test/suites/correctness_p0/test_outer_join_with_cross_join.groovy
index 15874dfdf1..507d2755dc 100644
--- 
a/regression-test/suites/correctness_p0/test_outer_join_with_cross_join.groovy
+++ 
b/regression-test/suites/correctness_p0/test_outer_join_with_cross_join.groovy
@@ -97,6 +97,21 @@ suite("test_outer_join_with_cross_join") {
         inner join test_outer_join_with_cross_join_outerjoin_C on true left 
join test_outer_join_with_cross_join_outerjoin_D on 
test_outer_join_with_cross_join_outerjoin_B.a = 
test_outer_join_with_cross_join_outerjoin_D.a;
     """
 
+    qt_select2 """
+        select
+        subq_0.`c3` as c0
+        from
+        (
+            select
+            ref_0.a as c3,
+            unhex(cast(version() as varchar)) as c4
+            from
+            test_outer_join_with_cross_join_outerjoin_A as ref_0
+        ) as subq_0
+        right join test_outer_join_with_cross_join_outerjoin_B as ref_3 on 
(subq_0.`c3` = ref_3.a)
+        inner join test_outer_join_with_cross_join_outerjoin_C as ref_4 on 
true;
+    """
+
     sql """
         drop table if exists test_outer_join_with_cross_join_outerjoin_A;
     """


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to