-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
executor: add batch copy to inner join, left and right outer join. #7493
Changes from 1 commit
0cc4ab9
2592034
265dd58
39cde9c
7b19c1c
e312fa4
4022038
9b6ce0f
315c1fa
37902a2
c4556b4
cefae06
9fe55b3
91366cd
d3f8e85
026be7f
50a698d
28018f9
2d04676
e47fb7c
3208738
cd6eda1
cedcd0e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,40 +72,43 @@ func (c *column) isNull(rowIdx int) bool { | |
return nullByte&(1<<(uint(rowIdx)&7)) == 0 | ||
} | ||
|
||
func (c *column) appendNullBitmap(on bool) { | ||
func (c *column) appendNullBitmap(notNull bool) { | ||
idx := c.length >> 3 | ||
if idx >= len(c.nullBitmap) { | ||
c.nullBitmap = append(c.nullBitmap, 0) | ||
} | ||
if on { | ||
if notNull { | ||
pos := uint(c.length) & 7 | ||
c.nullBitmap[idx] |= byte(1 << pos) | ||
} else { | ||
c.nullCount++ | ||
} | ||
} | ||
|
||
func (c *column) appendMultiSameNullBitmap(on bool, num int) { | ||
// appendMultiSameNullBitmap appends multiple same bit value to `nullBitMap`. | ||
// notNull mean not not null. | ||
// num mean appends `num` bit value to `nullBitMap`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. num means the number of bits that should be appended. |
||
func (c *column) appendMultiSameNullBitmap(notNull bool, num int) { | ||
numNewBytes := ((c.length + num + 7) >> 3) - len(c.nullBitmap) | ||
b := byte(0) | ||
if on { | ||
if notNull { | ||
b = 0xff | ||
} | ||
for i := 0; i < numNewBytes; i++ { | ||
c.nullBitmap = append(c.nullBitmap, b) | ||
} | ||
if on { | ||
// 1. Set all the higher 8-'numOldBits' bits in the last old byte to 1. | ||
numOldBits := uint(c.length % 8) | ||
bitMask := byte(^((1 << numOldBits) - 1)) | ||
c.nullBitmap[c.length/8] |= bitMask | ||
// 2. Set all the higher 'numRedundantBits' bits in the last new byte to 0. | ||
numRedundantBits := uint(len(c.nullBitmap)*8 - c.length - num) | ||
bitMask = byte(1<<(8-numRedundantBits)) - 1 | ||
c.nullBitmap[len(c.nullBitmap)-1] &= bitMask | ||
} else { | ||
if !notNull { | ||
c.nullCount += num | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we also need to set all the existing bits to zero even if |
||
return | ||
} | ||
// 1. Set all the higher 8-'numOldBits' bits in the last old byte to 1. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wait, I ask @CaitinChen There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @crazycs520 I prefer "the remaining bits" |
||
numOldBits := uint(c.length % 8) | ||
bitMask := byte(^((1 << numOldBits) - 1)) | ||
c.nullBitmap[c.length/8] |= bitMask | ||
// 2. Set all the higher 'numRedundantBits' bits in the last new byte to 0. | ||
numRedundantBits := uint(len(c.nullBitmap)*8 - c.length - num) | ||
bitMask = byte(1<<(8-numRedundantBits)) - 1 | ||
c.nullBitmap[len(c.nullBitmap)-1] &= bitMask | ||
} | ||
|
||
func (c *column) appendNull() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/ mean/ means
remove redundant not