diff --git a/be/src/vec/columns/column_complex.h b/be/src/vec/columns/column_complex.h index 95421d6ffa..95a6793853 100644 --- a/be/src/vec/columns/column_complex.h +++ b/be/src/vec/columns/column_complex.h @@ -364,6 +364,8 @@ size_t ColumnComplexType::filter(const IColumn::Filter& filter) { ++data_pos; } + data.resize(res_data - data.data()); + return res_data - data.data(); } diff --git a/be/src/vec/core/column_with_type_and_name.cpp b/be/src/vec/core/column_with_type_and_name.cpp index e196935bff..38f22db882 100644 --- a/be/src/vec/core/column_with_type_and_name.cpp +++ b/be/src/vec/core/column_with_type_and_name.cpp @@ -47,7 +47,11 @@ bool ColumnWithTypeAndName::operator==(const ColumnWithTypeAndName& other) const } void ColumnWithTypeAndName::dump_structure(std::ostream& out) const { - out << name; + if (name.empty()) { + out << "[Anonymous Column]"; + } else { + out << name; + } if (type) out << " " << type->get_name(); diff --git a/be/src/vec/sink/vmysql_result_writer.cpp b/be/src/vec/sink/vmysql_result_writer.cpp index d198ef38da..ca09c16663 100644 --- a/be/src/vec/sink/vmysql_result_writer.cpp +++ b/be/src/vec/sink/vmysql_result_writer.cpp @@ -75,6 +75,10 @@ Status VMysqlResultWriter::_add_one_column( SCOPED_TIMER(_convert_tuple_timer); const auto row_size = column_ptr->size(); + if (rows_buffer.size() != row_size) { + return Status::Error("row_size({}) != rows_buffer.size({})", + row_size, rows_buffer.size()); + } doris::vectorized::ColumnPtr column; if constexpr (is_nullable) { @@ -837,7 +841,8 @@ Status VMysqlResultWriter::append_block(Block& input_block) { } if (!status) { - LOG(WARNING) << "convert row to mysql result failed."; + LOG(WARNING) << "convert row to mysql result failed. block_struct=" + << block.dump_structure(); break; } } diff --git a/regression-test/data/query_p0/test_data_type_marks.out b/regression-test/data/query_p0/test_data_type_marks.out index 9e6993e9ba..f60a6c9939 100644 --- a/regression-test/data/query_p0/test_data_type_marks.out +++ b/regression-test/data/query_p0/test_data_type_marks.out @@ -5,3 +5,7 @@ 639215401565159424 1143681147589283841 test -- !select_two_marks -- + +-- !sql -- +1 + diff --git a/regression-test/suites/query_p0/test_data_type_marks.groovy b/regression-test/suites/query_p0/test_data_type_marks.groovy index e05ab27207..ccbe727759 100644 --- a/regression-test/suites/query_p0/test_data_type_marks.groovy +++ b/regression-test/suites/query_p0/test_data_type_marks.groovy @@ -39,4 +39,24 @@ suite("test_data_type_marks") { qt_select_one_marks "select * from org where id in ('639215401565159424') ;" qt_select_two_marks "select * from org where id in ('639215401565159424') and id='639237839376089088';" sql "DROP TABLE ${tbName}" + + sql "DROP TABLE IF EXISTS a_table" + sql """ + create table a_table( + k1 int null, + k2 int not null, + k3 bigint null, + k4 bigint sum null, + k5 bitmap bitmap_union null, + k6 hll hll_union null + ) + aggregate key (k1,k2,k3) + distributed BY hash(k1) buckets 3 + properties("replication_num" = "1"); + """ + sql """insert into a_table select 1,1,1,1,to_bitmap(1),hll_hash(1);""" + sql """insert into a_table select 2,2,1,2,to_bitmap(2),hll_hash(2);""" + sql """insert into a_table select 3,-3,-3,-3,to_bitmap(3),hll_hash(3);""" + + qt_sql """select bitmap_count(k5) from a_table where abs(k1)=1;""" }