-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-35867][SQL] Enable vectorized read for VectorizedPlainValuesReader.readBooleans #34611
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
Changes from all commits
213bd46
bc330b1
6bb9282
51d251a
c7699da
ba3b111
9cc1334
cdd0b10
41c8397
a24339a
15cdff3
8708ff1
a299f42
705f406
fc67e88
86d28cc
f5327bc
af97fb3
c89e81d
bccd3f7
c8680d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,7 @@ | |
| * WritableColumnVector are intended to be reused. | ||
| */ | ||
| public abstract class WritableColumnVector extends ColumnVector { | ||
| private final byte[] byte8 = new byte[8]; | ||
|
|
||
| /** | ||
| * Resets this column for writing. The currently stored values are no longer accessible. | ||
|
|
@@ -201,6 +202,29 @@ public WritableColumnVector reserveDictionaryIds(int capacity) { | |
| */ | ||
| public abstract void putBooleans(int rowId, int count, boolean value); | ||
|
|
||
| /** | ||
| * Sets bits from [src[srcIndex], src[srcIndex + count]) to [rowId, rowId + count) | ||
| * src must contain bit-packed 8 booleans in the byte. | ||
| */ | ||
| public void putBooleans(int rowId, int count, byte src, int srcIndex) { | ||
|
Member
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. This as a public API looks a bit dangerous.
Member
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. Thought about this too. Since this is hot path I think we can use
Contributor
Author
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. Thanks, added! |
||
| assert ((srcIndex + count) <= 8); | ||
| byte8[0] = (byte)(src & 1); | ||
| byte8[1] = (byte)(src >>> 1 & 1); | ||
| byte8[2] = (byte)(src >>> 2 & 1); | ||
| byte8[3] = (byte)(src >>> 3 & 1); | ||
| byte8[4] = (byte)(src >>> 4 & 1); | ||
| byte8[5] = (byte)(src >>> 5 & 1); | ||
| byte8[6] = (byte)(src >>> 6 & 1); | ||
| byte8[7] = (byte)(src >>> 7 & 1); | ||
| putBytes(rowId, count, byte8, srcIndex); | ||
| } | ||
|
|
||
| /** | ||
| * Sets bits from [src[0], src[7]] to [rowId, rowId + 7] | ||
| * src must contain bit-packed 8 booleans in the byte. | ||
| */ | ||
| public abstract void putBooleans(int rowId, byte src); | ||
|
|
||
| /** | ||
| * Sets `value` to the value at rowId. | ||
| */ | ||
|
|
@@ -470,6 +494,18 @@ public final int appendBooleans(int count, boolean v) { | |
| return result; | ||
| } | ||
|
|
||
| /** | ||
| * Append bits from [src[offset], src[offset + count]) | ||
| * src must contain bit-packed 8 booleans in the byte. | ||
| */ | ||
| public final int appendBooleans(int count, byte src, int offset) { | ||
| reserve(elementsAppended + count); | ||
| int result = elementsAppended; | ||
| putBooleans(elementsAppended, count, src, offset); | ||
| elementsAppended += count; | ||
| return result; | ||
| } | ||
|
|
||
| public final int appendByte(byte v) { | ||
| reserve(elementsAppended + 1); | ||
| putByte(elementsAppended, v); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.