Skip to content

Commit

Permalink
rollback the dedup filters to workaround an execution bug (matrixorig…
Browse files Browse the repository at this point in the history
…in#16842)

For undiscovered reason, executing a `serial` function in plan gives wrong result. I revert the affected code in matrixorigin#14541, to workaround it temporarily. The execution bug will be tracked in another issue.

Approved by: @ouyuanning
  • Loading branch information
aunjgr authored Jun 14, 2024
1 parent ee60c5e commit 03da85e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pkg/sql/plan/build_insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -809,11 +809,33 @@ func getPkValueExpr(builder *QueryBuilder, ctx CompilerContext, tableDef *TableD
pkExpr,
serialExpr,
})
} else if rowsCount <= 3 {
inArgs := make([]*plan.Expr, rowsCount)
for i := range inArgs {
serialArgs := make([]*plan.Expr, len(colExprs))
for j := range colExprs {
serialArgs[j] = colExprs[j][i]
}

inArgs[i], _ = BindFuncExprImplByPlanExpr(builder.GetContext(), "serial", serialArgs)
}
filterExpr, _ = BindFuncExprImplByPlanExpr(builder.GetContext(), "in", []*Expr{
pkExpr,
{
Typ: pkExpr.Typ,
Expr: &plan.Expr_List{
List: &plan.ExprList{
List: inArgs,
},
},
},
})
} else {
names := make([]string, len(lmap.m))
for n, p := range lmap.m {
names[p.order] = n
}
bat.Attrs = insertColsNameFromStmt
toSerialBatch := bat.GetSubBatch(names)
// serialize
// __cpkey__ in (serial(a1,b1,c1,d1),serial(a2,b2,c2,d2),xxx)
Expand Down

0 comments on commit 03da85e

Please sign in to comment.