Skip to content

Commit

Permalink
[CALCITE-6614] InnodbFilterRule incorrectly constructs condition when…
Browse files Browse the repository at this point in the history
… creating InnodbFilter
  • Loading branch information
suibianwanwan authored and mihaibudiu committed Nov 13, 2024
1 parent f14e944 commit 56f47ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,13 @@ RelNode convert(LogicalFilter filter, InnodbTableScan scan) {
final IndexCondition indexCondition =
translator.translateMatch(filter.getCondition());

RexNode condition =
RexUtil.composeConjunction(cluster.getRexBuilder(),
indexCondition.getPushDownConditions());
InnodbFilter innodbFilter =
InnodbFilter.create(cluster, traitSet,
convert(filter.getInput(), InnodbRel.CONVENTION),
filter.getCondition(), indexCondition, tableDef,
condition, indexCondition, tableDef,
scan.getForceIndexName());

// if some conditions can be pushed down, we left the remainder conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ protected InnodbToEnumerableConverter(

@Override public @Nullable RelOptCost computeSelfCost(RelOptPlanner planner,
RelMetadataQuery mq) {
final RelOptCost cost = requireNonNull(super.computeSelfCost(planner, mq));
return cost.multiplyBy(.1);
return requireNonNull(super.computeSelfCost(planner, mq));
}

static List<String> innodbFieldNames(final RelDataType rowType) {
Expand Down

0 comments on commit 56f47ee

Please sign in to comment.