Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b3c58a0
AggSpill 1: Adding save intermediate to agg exec.
fengttt Oct 16, 2025
42da5cb
Agg distinct is totally screwed.
fengttt Oct 21, 2025
39533f4
AggSpill 2: spill and load.
fengttt Oct 24, 2025
2f0928d
AggSpill 3: Save
fengttt Oct 25, 2025
8e2953a
Minor fixes, SCA.
fengttt Oct 27, 2025
b58797b
Fixes. Finally I can run select count(*)
fengttt Oct 28, 2025
b66690b
Fixes, more.
fengttt Oct 29, 2025
570b4cb
Make sure spillmem is passed to mergegroup as well.
fengttt Oct 30, 2025
c280a11
Bug fixes.
fengttt Oct 30, 2025
76f067b
Add a max_dop variable.
fengttt Oct 31, 2025
5a81ebb
Really spill.
fengttt Oct 31, 2025
e13cd7d
More fixes.
fengttt Nov 3, 2025
e4d7758
test case last.
fengttt Nov 3, 2025
878e6d7
Clean ups.
fengttt Nov 3, 2025
b3d36ae
Voodoo debugging.
fengttt Nov 6, 2025
d4eb6a7
Fix merge.
fengttt Nov 26, 2025
2082f95
Very funny extra level of abstraction.
fengttt Dec 1, 2025
1b4a952
Remove some really weird IngnoreMunmapError shit.
fengttt Dec 1, 2025
091a30f
Give hashmap a mpool.
fengttt Dec 2, 2025
7cf9f94
Reset proc message board.
fengttt Dec 4, 2025
5ae60fa
Fix distinctHash
fengttt Dec 4, 2025
0206e48
Fixing a bug that reset will release ctr.aggList and spillAggList.
fengttt Dec 4, 2025
9542dfa
Our malloc is so ...
fengttt Dec 4, 2025
418bea1
Merge remote-tracking branch 'upstream/main' into fengttt-spill-doit
fengttt Dec 5, 2025
1dab47f
Merge fixes.
fengttt Dec 5, 2025
ae0919f
Fix on mpool detail code rot.
fengttt Dec 5, 2025
86e0f7f
Use mp curbytes, fixing a hash problem.
fengttt Dec 5, 2025
cbc5d26
ReadBytes need to manage memory.
fengttt Dec 5, 2025
15596e3
Merge remote-tracking branch 'upstream/main' into fengttt-spill-doit
fengttt Dec 6, 2025
ae51eee
Get rid of fixedPool in mpool
fengttt Dec 7, 2025
91f24a7
Move sels from mpool to vector.
fengttt Dec 7, 2025
b433e6f
Fixing some UT issues.
fengttt Dec 7, 2025
9ba9260
Remove allocator
fengttt Dec 7, 2025
e40723a
Oh, my. mp will split the stack.
fengttt Dec 8, 2025
97d4cea
MPool by pass off heap stuff.
fengttt Dec 8, 2025
b046999
Cannot risk this.
fengttt Dec 8, 2025
b8976c7
Fixing UT.
fengttt Dec 8, 2025
151d6af
Tweaking.
fengttt Dec 8, 2025
e62e77d
Fix a nasty memory bug. #23240
fengttt Dec 8, 2025
f617570
Merge remote-tracking branch 'upstream/main' into fengttt-spill-doit
fengttt Dec 8, 2025
dbf67f6
More UT fixes.
fengttt Dec 8, 2025
9a1e07c
Merge remote-tracking branch 'upstream/main' into fengttt-spill-doit
fengttt Dec 9, 2025
ea972e8
Merge remote-tracking branch 'upstream/main' into fengttt-spill-doit
fengttt Dec 10, 2025
334a62f
Fix a boundary condition bug.
fengttt Dec 11, 2025
54114af
Use buffered io.
fengttt Dec 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/aws/smithy-go v1.22.1
github.com/axiomhq/hyperloglog v0.0.0-20230201085229-3ddf4bad03dc
github.com/buger/jsonparser v1.1.1
github.com/bytedance/sonic v1.14.1
github.com/bytedance/sonic v1.14.2
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5
github.com/cespare/xxhash/v2 v2.3.0
github.com/cockroachdb/errors v1.9.1
Expand Down Expand Up @@ -131,7 +131,7 @@ require (
github.com/bits-and-blooms/bitset v1.8.0 // indirect
github.com/bufbuild/protocompile v0.6.0 // indirect
github.com/bytedance/gopkg v0.1.3 // indirect
github.com/bytedance/sonic/loader v0.3.0 // indirect
github.com/bytedance/sonic/loader v0.4.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cilium/ebpf v0.9.1 // indirect
github.com/clbanning/mxj v1.8.4 // indirect
Expand Down
9 changes: 5 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMU
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M=
github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
github.com/bytedance/sonic v1.14.1 h1:FBMC0zVz5XUmE4z9wF4Jey0An5FueFvOsTKKKtwIl7w=
github.com/bytedance/sonic v1.14.1/go.mod h1:gi6uhQLMbTdeP0muCnrjHLeCUPyb70ujhnNlhOylAFc=
github.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=
github.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
github.com/bytedance/sonic v1.14.2 h1:k1twIoe97C1DtYUo+fZQy865IuHia4PR5RPiuGPPIIE=
github.com/bytedance/sonic v1.14.2/go.mod h1:T80iDELeHiHKSc0C9tubFygiuXoGzrkjKzX2quAx980=
github.com/bytedance/sonic/loader v0.4.0 h1:olZ7lEqcxtZygCK9EKYKADnpQoYkRQxaeY2NYzevs+o=
github.com/bytedance/sonic/loader v0.4.0/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo=
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5 h1:BjkPE3785EwPhhyuFkbINB+2a1xATwk8SNDWnJiD41g=
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5/go.mod h1:jtAfVaU/2cu1+wdSRPWE2c1N2qeAA3K4RH9pYgqwets=
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
Expand Down Expand Up @@ -785,6 +785,7 @@ github.com/spkg/bom v1.0.0/go.mod h1:lAz2VbTuYNcvs7iaFF8WW0ufXrHShJ7ck1fYFFbVXJs
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
Expand Down
37 changes: 23 additions & 14 deletions pkg/bootstrap/versions/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package versions
import (
"testing"

"github.com/matrixorigin/matrixone/pkg/common/mpool"
"github.com/matrixorigin/matrixone/pkg/common/pubsub"
"github.com/matrixorigin/matrixone/pkg/container/batch"
"github.com/matrixorigin/matrixone/pkg/testutil"
Expand All @@ -26,32 +27,34 @@ import (
"github.com/stretchr/testify/assert"
)

type MockTxnExecutor struct{}
type MockTxnExecutor struct {
mp *mpool.MPool
}

func (MockTxnExecutor) Use(db string) {
func (mock *MockTxnExecutor) Use(db string) {
//TODO implement me
panic("implement me")
}

func (MockTxnExecutor) LockTable(table string) error {
func (mock *MockTxnExecutor) LockTable(table string) error {
//TODO implement me
panic("implement me")
}

func (MockTxnExecutor) Exec(sql string, options executor.StatementOption) (executor.Result, error) {
func (mock *MockTxnExecutor) Exec(sql string, options executor.StatementOption) (executor.Result, error) {
bat := batch.New([]string{"a", "b", "c", "d", "e", "f", "g", "h"})
bat.Vecs[0] = testutil.MakeVarcharVector([]string{"PubName"}, nil)
bat.Vecs[1] = testutil.MakeVarcharVector([]string{"DbName"}, nil)
bat.Vecs[2] = testutil.MakeUint64Vector([]uint64{1}, nil)
bat.Vecs[3] = testutil.MakeVarcharVector([]string{"TablesStr"}, nil)
bat.Vecs[4] = testutil.MakeVarcharVector([]string{"SubAccountsStr"}, nil)
bat.Vecs[5] = testutil.MakeTimestampVector([]string{"2023-02-03 01:23:45"}, nil)
bat.Vecs[6] = testutil.MakeTimestampVector([]string{"2023-02-03 01:23:45"}, nil)
bat.Vecs[7] = testutil.MakeVarcharVector([]string{"Comment"}, nil)
bat.Vecs[0] = testutil.MakeVarcharVector([]string{"PubName"}, nil, mock.mp)
bat.Vecs[1] = testutil.MakeVarcharVector([]string{"DbName"}, nil, mock.mp)
bat.Vecs[2] = testutil.MakeUint64Vector([]uint64{1}, nil, mock.mp)
bat.Vecs[3] = testutil.MakeVarcharVector([]string{"TablesStr"}, nil, mock.mp)
bat.Vecs[4] = testutil.MakeVarcharVector([]string{"SubAccountsStr"}, nil, mock.mp)
bat.Vecs[5] = testutil.MakeTimestampVector([]string{"2023-02-03 01:23:45"}, nil, mock.mp)
bat.Vecs[6] = testutil.MakeTimestampVector([]string{"2023-02-03 01:23:45"}, nil, mock.mp)
bat.Vecs[7] = testutil.MakeVarcharVector([]string{"Comment"}, nil, mock.mp)
bat.SetRowCount(1)
return executor.Result{
Batches: []*batch.Batch{bat},
Mp: testutil.TestUtilMp,
Mp: mock.mp,
}, nil
}

Expand All @@ -69,7 +72,13 @@ func TestGetAllPubInfos(t *testing.T) {
accNameInfoMap := map[string]*pubsub.AccountInfo{
"sys": {Id: 0, Name: "sys"},
}
infos, err := GetAllPubInfos(&MockTxnExecutor{}, accNameInfoMap)

mock := &MockTxnExecutor{
mp: mpool.MustNewZeroNoFixed(),
}
defer mpool.DeleteMPool(mock.mp)

infos, err := GetAllPubInfos(mock, accNameInfoMap)
assert.NoError(t, err)
assert.Equal(t, 1, len(infos))
}
32 changes: 23 additions & 9 deletions pkg/bootstrap/versions/v2_0_1/pubsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"testing"

"github.com/matrixorigin/matrixone/pkg/bootstrap/versions"
"github.com/matrixorigin/matrixone/pkg/common/mpool"
"github.com/matrixorigin/matrixone/pkg/common/pubsub"
"github.com/matrixorigin/matrixone/pkg/container/batch"
"github.com/matrixorigin/matrixone/pkg/testutil"
Expand All @@ -30,29 +31,30 @@ import (

type MockTxnExecutor struct {
flag bool
mp *mpool.MPool
}

func (MockTxnExecutor) Use(db string) {
func (mock *MockTxnExecutor) Use(db string) {
//TODO implement me
panic("implement me")
}

func (MockTxnExecutor) LockTable(table string) error {
func (mock *MockTxnExecutor) LockTable(table string) error {
//TODO implement me
panic("implement me")
}

func (e MockTxnExecutor) Exec(sql string, options executor.StatementOption) (executor.Result, error) {
if strings.HasPrefix(sql, "delete from mo_catalog.mo_subs") && e.flag {
func (mock *MockTxnExecutor) Exec(sql string, options executor.StatementOption) (executor.Result, error) {
if strings.HasPrefix(sql, "delete from mo_catalog.mo_subs") && mock.flag {
return executor.Result{}, assert.AnError
}

bat := batch.New([]string{"a"})
bat.Vecs[0] = testutil.MakeInt32Vector([]int32{1}, nil)
bat.Vecs[0] = testutil.MakeInt32Vector([]int32{1}, nil, mock.mp)
bat.SetRowCount(1)
return executor.Result{
Batches: []*batch.Batch{bat},
Mp: testutil.TestUtilMp,
Mp: mock.mp,
}, nil
}

Expand All @@ -62,7 +64,12 @@ func (MockTxnExecutor) Txn() client.TxnOperator {
}

func Test_getSubbedAccNames(t *testing.T) {
txn := &MockTxnExecutor{}
txn := &MockTxnExecutor{
mp: mpool.MustNewZeroNoFixed(),
}
txn.mp.EnableDetailRecording()
defer mpool.DeleteMPool(txn.mp)

accIdInfoMap := map[int32]*pubsub.AccountInfo{
1: {Id: 1, Name: "acc1"},
}
Expand Down Expand Up @@ -109,7 +116,10 @@ func Test_migrateMoPubs(t *testing.T) {
)
defer getSubbedAccNamesStub.Reset()

txn := &MockTxnExecutor{}
txn := &MockTxnExecutor{
mp: mpool.MustNewZeroNoFixed(),
}
defer mpool.DeleteMPool(txn.mp)
err := migrateMoPubs(txn)
assert.NoError(t, err)
}
Expand Down Expand Up @@ -152,7 +162,11 @@ func Test_migrateMoPubs_deleteFailed(t *testing.T) {
)
defer getSubbedAccNamesStub.Reset()

txn := &MockTxnExecutor{flag: true}
txn := &MockTxnExecutor{
flag: true,
mp: mpool.MustNewZeroNoFixed(),
}
defer mpool.DeleteMPool(txn.mp)
err := migrateMoPubs(txn)
assert.Error(t, err)
}
7 changes: 5 additions & 2 deletions pkg/cdc/sinker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,12 @@ func TestNewConsoleSinker(t *testing.T) {
}

func Test_consoleSinker_Sink(t *testing.T) {
proc := testutil.NewProcess(t)
defer proc.Free()

bat := batch.New([]string{"a", "b", "c"})
bat.Vecs[0] = testutil.MakeInt32Vector([]int32{1, 2, 3}, nil)
bat.Vecs[1] = testutil.MakeInt32Vector([]int32{1, 2, 3}, nil)
bat.Vecs[0] = testutil.MakeInt32Vector([]int32{1, 2, 3}, nil, proc.Mp())
bat.Vecs[1] = testutil.MakeInt32Vector([]int32{1, 2, 3}, nil, proc.Mp())
bat.SetRowCount(3)

fromTs := types.BuildTS(1, 1)
Expand Down
48 changes: 27 additions & 21 deletions pkg/cdc/table_scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,19 @@ func TestTableScanner1(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

proc := testutil.NewProcess(t)
defer proc.Free()

bat := batch.New([]string{"tblId", "tblName", "dbId", "dbName", "createSql", "accountId"})
bat.Vecs[0] = testutil.MakeUint64Vector([]uint64{1}, nil)
bat.Vecs[1] = testutil.MakeVarcharVector([]string{"tblName"}, nil)
bat.Vecs[2] = testutil.MakeUint64Vector([]uint64{1}, nil)
bat.Vecs[3] = testutil.MakeVarcharVector([]string{"dbName"}, nil)
bat.Vecs[4] = testutil.MakeVarcharVector([]string{"createSql"}, nil)
bat.Vecs[5] = testutil.MakeUint32Vector([]uint32{1}, nil)
bat.Vecs[0] = testutil.MakeUint64Vector([]uint64{1}, nil, proc.Mp())
bat.Vecs[1] = testutil.MakeVarcharVector([]string{"tblName"}, nil, proc.Mp())
bat.Vecs[2] = testutil.MakeUint64Vector([]uint64{1}, nil, proc.Mp())
bat.Vecs[3] = testutil.MakeVarcharVector([]string{"dbName"}, nil, proc.Mp())
bat.Vecs[4] = testutil.MakeVarcharVector([]string{"createSql"}, nil, proc.Mp())
bat.Vecs[5] = testutil.MakeUint32Vector([]uint32{1}, nil, proc.Mp())
bat.SetRowCount(1)
res := executor.Result{
Mp: testutil.TestUtilMp,
Mp: proc.Mp(),
Batches: []*batch.Batch{bat},
}

Expand Down Expand Up @@ -850,29 +853,32 @@ func TestTableScanner_UpdateTableInfo(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

proc := testutil.NewProcess(t)
defer proc.Free()

bat1 := batch.New([]string{"tblId", "tblName", "dbId", "dbName", "createSql", "accountId"})
bat1.Vecs[0] = testutil.MakeUint64Vector([]uint64{1001}, nil)
bat1.Vecs[1] = testutil.MakeVarcharVector([]string{"tbl1"}, nil)
bat1.Vecs[2] = testutil.MakeUint64Vector([]uint64{1}, nil)
bat1.Vecs[3] = testutil.MakeVarcharVector([]string{"db1"}, nil)
bat1.Vecs[4] = testutil.MakeVarcharVector([]string{"create table tbl1 (a int)"}, nil)
bat1.Vecs[5] = testutil.MakeUint32Vector([]uint32{1}, nil)
bat1.Vecs[0] = testutil.MakeUint64Vector([]uint64{1001}, nil, proc.Mp())
bat1.Vecs[1] = testutil.MakeVarcharVector([]string{"tbl1"}, nil, proc.Mp())
bat1.Vecs[2] = testutil.MakeUint64Vector([]uint64{1}, nil, proc.Mp())
bat1.Vecs[3] = testutil.MakeVarcharVector([]string{"db1"}, nil, proc.Mp())
bat1.Vecs[4] = testutil.MakeVarcharVector([]string{"create table tbl1 (a int)"}, nil, proc.Mp())
bat1.Vecs[5] = testutil.MakeUint32Vector([]uint32{1}, nil, proc.Mp())
bat1.SetRowCount(1)
res1 := executor.Result{
Mp: testutil.TestUtilMp,
Mp: proc.Mp(),
Batches: []*batch.Batch{bat1},
}

bat2 := batch.New([]string{"tblId", "tblName", "dbId", "dbName", "createSql", "accountId"})
bat2.Vecs[0] = testutil.MakeUint64Vector([]uint64{1002}, nil) // 新的表ID
bat2.Vecs[1] = testutil.MakeVarcharVector([]string{"tbl1"}, nil)
bat2.Vecs[2] = testutil.MakeUint64Vector([]uint64{1}, nil)
bat2.Vecs[3] = testutil.MakeVarcharVector([]string{"db1"}, nil)
bat2.Vecs[4] = testutil.MakeVarcharVector([]string{"create table tbl1 (a int)"}, nil)
bat2.Vecs[5] = testutil.MakeUint32Vector([]uint32{1}, nil)
bat2.Vecs[0] = testutil.MakeUint64Vector([]uint64{1002}, nil, proc.Mp())
bat2.Vecs[1] = testutil.MakeVarcharVector([]string{"tbl1"}, nil, proc.Mp())
bat2.Vecs[2] = testutil.MakeUint64Vector([]uint64{1}, nil, proc.Mp())
bat2.Vecs[3] = testutil.MakeVarcharVector([]string{"db1"}, nil, proc.Mp())
bat2.Vecs[4] = testutil.MakeVarcharVector([]string{"create table tbl1 (a int)"}, nil, proc.Mp())
bat2.Vecs[5] = testutil.MakeUint32Vector([]uint32{1}, nil, proc.Mp())
bat2.SetRowCount(1)
res2 := executor.Result{
Mp: testutil.TestUtilMp,
Mp: proc.Mp(),
Batches: []*batch.Batch{bat2},
}

Expand Down
32 changes: 23 additions & 9 deletions pkg/cdc/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,36 @@ import (
)

func TestNewAtomicBatch(t *testing.T) {
actual := NewAtomicBatch(testutil.TestUtilMp)
mp := mpool.MustNewZeroNoFixed()
defer mpool.DeleteMPool(mp)
actual := NewAtomicBatch(mp)
assert.NotNil(t, actual.Rows)
assert.Equal(t, 0, actual.Rows.Len())
}

func TestAtomicBatch_Append(t *testing.T) {
mp := mpool.MustNewZeroNoFixed()
defer mpool.DeleteMPool(mp)

atomicBat := &AtomicBatch{
Batches: []*batch.Batch{},
Rows: btree.NewBTreeGOptions(AtomicBatchRow.Less, btree.Options{Degree: 64}),
}
bat := batch.New([]string{"pk", "ts"})
bat.Vecs[0] = testutil.MakeInt32Vector([]int32{1}, nil)
bat.Vecs[1] = testutil.MakeTSVector([]types.TS{types.BuildTS(1, 1)}, nil)
bat.Vecs[0] = testutil.MakeInt32Vector([]int32{1}, nil, mp)
bat.Vecs[1] = testutil.MakeTSVector([]types.TS{types.BuildTS(1, 1)}, nil, mp)

atomicBat.Append(types.NewPacker(), bat, 1, 0)
assert.Equal(t, 1, len(atomicBat.Batches))
assert.Equal(t, 1, atomicBat.Rows.Len())
}

func TestAtomicBatch_Close(t *testing.T) {
mp := mpool.MustNewZeroNoFixed()
defer mpool.DeleteMPool(mp)

bat := batch.New([]string{"attr1"})
bat.Vecs[0] = testutil.MakeInt32Vector([]int32{1}, nil)
bat.Vecs[0] = testutil.MakeInt32Vector([]int32{1}, nil, mp)

type fields struct {
Mp *mpool.MPool
Expand All @@ -63,7 +71,7 @@ func TestAtomicBatch_Close(t *testing.T) {
}{
{
fields: fields{
Mp: testutil.TestUtilMp,
Mp: mp,
Batches: []*batch.Batch{bat},
Rows: btree.NewBTreeGOptions(AtomicBatchRow.Less, btree.Options{Degree: 64}),
},
Expand Down Expand Up @@ -174,8 +182,11 @@ func Test_atomicBatchRowIter(t *testing.T) {
rows.Set(row2)
rows.Set(row3)

mp := mpool.MustNewZeroNoFixed()
defer mpool.DeleteMPool(mp)

bat := batch.New([]string{"attr1"})
bat.Vecs[0] = testutil.MakeInt32Vector([]int32{1}, nil)
bat.Vecs[0] = testutil.MakeInt32Vector([]int32{1}, nil, mp)

// at init position (before the first row)
iter := &atomicBatchRowIter{
Expand Down Expand Up @@ -204,13 +215,16 @@ func Test_atomicBatchRowIter(t *testing.T) {
}

func TestAtomicBatch_RowCountDeduplicates(t *testing.T) {
bat := NewAtomicBatch(testutil.TestUtilMp)
mp := mpool.MustNewZeroNoFixed()
defer mpool.DeleteMPool(mp)

bat := NewAtomicBatch(mp)
ts := types.BuildTS(10, 2)

createBatch := func(pk int32) *batch.Batch {
b := batch.New([]string{"pk", "ts"})
b.Vecs[0] = testutil.MakeInt32Vector([]int32{pk}, nil)
b.Vecs[1] = testutil.MakeTSVector([]types.TS{ts}, nil)
b.Vecs[0] = testutil.MakeInt32Vector([]int32{pk}, nil, mp)
b.Vecs[1] = testutil.MakeTSVector([]types.TS{ts}, nil, mp)
return b
}

Expand Down
Loading
Loading