Skip to content

Commit

Permalink
TPE: fix errors of filling the vector for char and varchar (matrixori…
Browse files Browse the repository at this point in the history
  • Loading branch information
daviszhen authored Apr 13, 2022
1 parent e1b31f7 commit d0a9964
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/vm/engine/tpe/tuplecodec/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,9 @@ func TruncateBatch(bat *batch.Batch, batchSize, needLen int) {
case types.T_char, types.T_varchar: //bytes is different
vBytes := vec.Col.(*types.Bytes)
if len(vBytes.Offsets) > needLen {
nextStart := vBytes.Offsets[needLen]
vec.Col = vBytes.Window(0, needLen)
vBytes.Data = vBytes.Data[:nextStart]
}
vec.Data = vBytes.Data
case types.T_date:
Expand Down Expand Up @@ -480,7 +482,7 @@ func ConvertAttributeDescIntoTypesType(attrs []*descriptor.AttributeDesc) ([]str
defs = append(defs, &engine.AttributeDef{Attr: engine.Attribute{
Name: attr.Name,
Alg: 0,
Type: TpeTypeToEngineType(attr.Ttype),
Type: attr.TypesType,
Default: engine.DefaultExpr{},
}})
}
Expand Down

0 comments on commit d0a9964

Please sign in to comment.