Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed Dec 4, 2024
1 parent 2057745 commit d2a8f61
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ struct AggOrthBitmapExprCalBaseData {
if (first_init) {
DCHECK(argument_size > 1);
const auto& col =
assert_cast<const ColVecData&, TypeCheckOnRelease::DISABLE>(*columns[2]);
assert_cast<const ColumnString&, TypeCheckOnRelease::DISABLE>(*columns[2]);
std::string expr = col.get_data_at(row_num).to_string();
bitmap_expr_cal.bitmap_calculation_init(expr);
first_init = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@
public class OrthogonalBitmapExprCalculate extends NotNullableAggregateFunction
implements OrthogonalBitmapFunction, ExplicitlyCastableSignature {

static final List<FunctionSignature> FUNCTION_SIGNATURES = SUPPORTED_TYPES.stream()
.map(type ->
FunctionSignature.ret(BitmapType.INSTANCE)
.varArgs(BitmapType.INSTANCE, type, VarcharType.SYSTEM_DEFAULT)
)
.collect(ImmutableList.toImmutableList());
static final List<FunctionSignature> FUNCTION_SIGNATURES = ImmutableList.of(
FunctionSignature.ret(BitmapType.INSTANCE)
.varArgs(BitmapType.INSTANCE, VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT)
);

/**
* constructor with 3 arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.functions.scalar.BitmapEmpty;
import org.apache.doris.nereids.trees.expressions.literal.VarcharLiteral;
import org.apache.doris.nereids.types.BigIntType;
import org.apache.doris.nereids.types.BitmapType;
import org.apache.doris.nereids.types.VarcharType;
import org.apache.doris.nereids.util.ExpressionUtils;
Expand All @@ -35,12 +36,10 @@
public class OrthogonalBitmapExprCalculateCount extends NotNullableAggregateFunction
implements OrthogonalBitmapFunction, ExplicitlyCastableSignature {

static final List<FunctionSignature> FUNCTION_SIGNATURES = SUPPORTED_TYPES.stream()
.map(type ->
FunctionSignature.ret(BitmapType.INSTANCE)
.varArgs(BitmapType.INSTANCE, type, VarcharType.SYSTEM_DEFAULT)
)
.collect(ImmutableList.toImmutableList());
static final List<FunctionSignature> FUNCTION_SIGNATURES = ImmutableList.of(
FunctionSignature.ret(BigIntType.INSTANCE)
.varArgs(BitmapType.INSTANCE, VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT)
);

/**
* constructor with 3 arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ suite("test_orthogonal_bitmap_expr_calculate") {
user_id bitmap bitmap_union
)
aggregate key(id, tag)
distributed by hash(id) buckets 10
distributed by hash(id) buckets 1
properties(
'replication_num'='1'
);
Expand All @@ -37,12 +37,19 @@ suite("test_orthogonal_bitmap_expr_calculate") {
set enable_fallback_to_original_planner=false;
"""


test {
sql """
select bitmap_to_string(orthogonal_bitmap_expr_calculate(user_id, tag, '(100&200)'))
from test_orthogonal_bitmap_expr_calculate
"""
result([['3,4,5']])
}

test {
sql """
select orthogonal_bitmap_expr_calculate_count(user_id, tag, '(100&200)')
from test_orthogonal_bitmap_expr_calculate
"""
result([[3L]])
}
}

0 comments on commit d2a8f61

Please sign in to comment.