Skip to content

Commit

Permalink
[Bug](runtime-filter) fix coredump on no null string type rf (#33869)
Browse files Browse the repository at this point in the history
fix coredump on no null string type rf
  • Loading branch information
BiteTheDDDDt authored Apr 19, 2024
1 parent 198496b commit d1a10ae
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
4 changes: 2 additions & 2 deletions be/src/exprs/hybrid_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ class StringSet : public HybridSetBase {
void _insert_fixed_len_string(const auto& col, const uint8_t* __restrict nullmap, size_t start,
size_t end) {
for (size_t i = start; i < end; i++) {
if (nullmap != nullptr || !nullmap[i]) {
if (nullmap == nullptr || !nullmap[i]) {
_set.insert(col.get_data_at(i).to_string());
} else {
_contains_null = true;
Expand Down Expand Up @@ -583,7 +583,7 @@ class StringValueSet : public HybridSetBase {
void _insert_fixed_len_string(const auto& col, const uint8_t* __restrict nullmap, size_t start,
size_t end) {
for (size_t i = start; i < end; i++) {
if (nullmap != nullptr || !nullmap[i]) {
if (nullmap == nullptr || !nullmap[i]) {
_set.insert(col.get_data_at(i));
} else {
_contains_null = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !test --
4

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

suite("no_null_str_rf") {
sql """ DROP TABLE IF EXISTS d_table; """
sql """ DROP TABLE IF EXISTS dd_table; """
sql """
create table d_table(
k1 int null,
k2 int not null,
k3 bigint null,
k4 varchar(100) not null
)
duplicate key (k1,k2,k3)
distributed BY hash(k1) buckets 3
properties("replication_num" = "1");
"""

sql "insert into d_table select 1,1,1,'a';"
sql "insert into d_table select 1,1,1,'b';"
sql "insert into d_table select 1,1,1,'a';"
sql "insert into d_table select 1,1,1,'b';"
sql "insert into d_table select 1,1,1,'a';"
sql "insert into d_table select 1,1,1,'b';"
sql "insert into d_table select 1,1,1,'a';"
sql "insert into d_table select 1,1,1,'b';"

sql """
create table dd_table(
k1 int null,
k2 int not null,
k3 bigint null,
k4 varchar(100) not null
)
duplicate key (k1,k2,k3)
distributed BY hash(k1) buckets 3
properties("replication_num" = "1");
"""

sql "insert into dd_table select 1,1,1,'a';"
sql "insert into dd_table select 1,1,1,'c';"

qt_test """select count(1) from d_table,dd_table where d_table.k4=dd_table.k4 and d_table.k1=1 and dd_table.k1=1;"""
}

0 comments on commit d1a10ae

Please sign in to comment.