Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d7e6a36
feat: add binary string metadata foundation
ck89119 Aug 10, 2026
badb8d3
feat: preserve binary string planner semantics
ck89119 Aug 10, 2026
b66fa69
feat: preserve binary string execution semantics
ck89119 Aug 10, 2026
5364e3b
Merge branch 'main' into issue-25295-binary-metadata
mergify[bot] Aug 10, 2026
4977aaa
fix: close binary metadata lifecycle gaps
ck89119 Aug 10, 2026
ffda27b
Merge remote-tracking branch 'mo/main' into issue-25295-binary-metadata
ck89119 Aug 10, 2026
ffddc4e
Merge branch 'issue-25295-binary-metadata' into issue-25295-binary-pl…
ck89119 Aug 10, 2026
0150e46
Merge branch 'issue-25295-binary-planner' into issue-25295-binary-exe…
ck89119 Aug 10, 2026
3c493d4
fix: resolve stacked remote wire guard
ck89119 Aug 10, 2026
c3c9387
Merge remote-tracking branch 'mo/main' into issue-25295-binary-metadata
ck89119 Aug 10, 2026
65f2703
fix: close binary metadata lifecycle gaps
ck89119 Aug 10, 2026
2e94493
Merge branch 'issue-25295-binary-metadata' into issue-25295-binary-pl…
ck89119 Aug 10, 2026
da7118b
Merge branch 'issue-25295-binary-planner' into issue-25295-binary-exe…
ck89119 Aug 10, 2026
20c003e
fix: preserve binary metadata transitions
ck89119 Aug 10, 2026
1cb7609
Merge remote-tracking branch 'mo/main' into issue-25295-binary-metadata
ck89119 Aug 10, 2026
9d6423c
Merge branch 'issue-25295-binary-metadata' into issue-25295-binary-pl…
ck89119 Aug 10, 2026
c0b3a27
fix: publish binary result metadata after append
ck89119 Aug 10, 2026
d362456
Merge branch 'issue-25295-binary-planner' into issue-25295-binary-exe…
ck89119 Aug 10, 2026
8ac3c67
fix: publish group concat binary metadata after flush
ck89119 Aug 10, 2026
0dceb33
fix: make binary metadata updates atomic
ck89119 Aug 11, 2026
8e70876
Merge remote-tracking branch 'mo/main' into issue-25295-binary-metadata
ck89119 Aug 11, 2026
5464178
Merge branch 'issue-25295-binary-metadata' into issue-25295-binary-pl…
ck89119 Aug 11, 2026
f76c607
Merge branch 'issue-25295-binary-planner' into issue-25295-binary-exe…
ck89119 Aug 11, 2026
630e0e6
Merge remote-tracking branch 'mo/main' into issue-25295-binary-metadata
ck89119 Aug 11, 2026
f08cc99
Merge branch 'issue-25295-binary-metadata' into issue-25295-binary-pl…
ck89119 Aug 11, 2026
d33721f
Merge branch 'issue-25295-binary-planner' into issue-25295-binary-exe…
ck89119 Aug 11, 2026
cd3c02d
fix: preserve binary metadata during materialization
ck89119 Aug 11, 2026
9893815
Merge branch 'issue-25295-binary-metadata' into issue-25295-binary-pl…
ck89119 Aug 11, 2026
64ad80b
Merge branch 'issue-25295-binary-planner' into issue-25295-binary-exe…
ck89119 Aug 11, 2026
aeabd46
fix: retain row-level aggregate binary metadata
ck89119 Aug 11, 2026
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
12 changes: 9 additions & 3 deletions pkg/common/bitmap/bitmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,12 @@ func (n *Bitmap) RemapOrdered(sels []int64, negate bool) {
// RemapMaskOrdered is RemapOrdered for an ordered bitmap selection. Selection
// bitmap iteration is monotonic, so the rewrite uses no row-scaled scratch.
func (n *Bitmap) RemapMaskOrdered(sels *Bitmap, negate bool) {
n.RemapMaskOrderedWithOffset(sels, negate, 0)
}

// RemapMaskOrderedWithOffset applies an ordered bitmap selection after adding
// offset to every selected source row, without materializing an index slice.
func (n *Bitmap) RemapMaskOrderedWithOffset(sels *Bitmap, negate bool, offset uint64) {
if n == nil || sels == nil {
return
}
Expand Down Expand Up @@ -570,19 +576,19 @@ func (n *Bitmap) RemapMaskOrdered(sels *Bitmap, negate bool) {
iterator := sels.Iterator()
if !negate {
for iterator.HasNext() {
source := int64(iterator.Next())
source := int64(iterator.Next() + offset)
writeDestination(output, readSource(source))
output++
}
} else {
var selected int64 = -1
if iterator.HasNext() {
selected = int64(iterator.Next())
selected = int64(iterator.Next() + offset)
}
for source := int64(0); source < oldLength; source++ {
if source == selected {
if iterator.HasNext() {
selected = int64(iterator.Next())
selected = int64(iterator.Next() + offset)
} else {
selected = -1
}
Expand Down
22 changes: 22 additions & 0 deletions pkg/common/bitmap/bitmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,28 @@ func TestBitmapRemapMaskOrdered(t *testing.T) {
require.True(t, value.Contains(125))
}

func TestBitmapRemapMaskOrderedWithOffset(t *testing.T) {
selection := newBm(129)
selection.AddMany([]uint64{0, 62, 128})

var value Bitmap
value.InitWithSize(130)
value.AddMany([]uint64{1, 63, 64, 127, 129})
value.RemapMaskOrderedWithOffset(selection, false, 1)
require.Equal(t, int64(3), value.Len())
require.Equal(t, 3, value.Count())
require.True(t, value.Contains(0))
require.True(t, value.Contains(1))
require.True(t, value.Contains(2))

value.InitWithSize(130)
value.AddMany([]uint64{1, 63, 64, 127, 129})
value.RemapMaskOrderedWithOffset(selection, true, 1)
require.Equal(t, 2, value.Count())
require.True(t, value.Contains(62))
require.True(t, value.Contains(125))
}

func TestBitmapExternalStorageUnmarshal(t *testing.T) {
source := newBm(128)
source.Add(1)
Expand Down
13 changes: 12 additions & 1 deletion pkg/container/batch/allocation_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ func TestBatchGroupingCodecRoundTrip(t *testing.T) {
source := newBatchAllocationTestSource(t, mp, nil)
source.Vecs[0].GetGrouping().Add(1, 7, 31)
source.Vecs[1].GetGrouping().Add(2, 9)
require.NoError(t, source.Vecs[1].SetIsBinaryStringAt(0, true))
kinds := make([]vector.PrepareParamKind, source.RowCount())
kinds[0] = vector.PrepareParamInteger
require.NoError(t, source.Vecs[1].SetPrepareParamKindsWithMP(kinds, mp))
source.ExtraBuf = bytes.Repeat([]byte("x"), 1<<20)

var encoded bytes.Buffer
Expand All @@ -316,6 +320,9 @@ func TestBatchGroupingCodecRoundTrip(t *testing.T) {
for i := range source.Vecs {
require.True(t, decoded.Vecs[i].GetGrouping().IsSame(source.Vecs[i].GetGrouping()))
}
require.True(t, decoded.Vecs[1].GetIsBinaryStringAt(0))
require.False(t, decoded.Vecs[1].GetIsBinaryStringAt(1))
require.Equal(t, vector.PrepareParamInteger, decoded.Vecs[1].GetPrepareParamKindAt(0))
withoutGrouping := newBatchAllocationTestSource(t, mp, nil)
encoded.Reset()
require.NoError(t, withoutGrouping.MarshalBinaryWithGroupingTo(&encoded))
Expand Down Expand Up @@ -355,8 +362,12 @@ func TestBatchGroupingCodecRejectsStableMetadataBeforePayloadAllocation(t *testi
source := NewWithSize(0)
source.Attrs = test.attrs
source.ExtraBuf = test.extra
var payload bytes.Buffer
require.NoError(t, source.MarshalBinaryTo(&payload))
var encoded bytes.Buffer
require.NoError(t, source.MarshalBinaryTo(&encoded))
payloadSize := int64(payload.Len())
encoded.Write(types.EncodeInt64(&payloadSize))
encoded.Write(payload.Bytes())

decoded := NewOffHeapEmpty()
require.NoError(t, decoded.SetAllocationAccount(state.selection))
Expand Down
Loading
Loading