[Bug](function) fix column complex not resize after filter (#18043)

This commit is contained in:
Pxl
2023-03-25 21:48:13 +08:00
committed by GitHub
parent 77c9550420
commit a8753faeb1
5 changed files with 37 additions and 2 deletions

View File

@ -364,6 +364,8 @@ size_t ColumnComplexType<T>::filter(const IColumn::Filter& filter) {
++data_pos;
}
data.resize(res_data - data.data());
return res_data - data.data();
}

View File

@ -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();

View File

@ -75,6 +75,10 @@ Status VMysqlResultWriter<is_binary_format>::_add_one_column(
SCOPED_TIMER(_convert_tuple_timer);
const auto row_size = column_ptr->size();
if (rows_buffer.size() != row_size) {
return Status::Error<ErrorCode::INTERNAL_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<is_binary_format>::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;
}
}

View File

@ -5,3 +5,7 @@
639215401565159424 1143681147589283841 test
-- !select_two_marks --
-- !sql --
1

View File

@ -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;"""
}