diff --git a/sstable/colblk/data_block.go b/sstable/colblk/data_block.go index c44bbf7842..6caef3719e 100644 --- a/sstable/colblk/data_block.go +++ b/sstable/colblk/data_block.go @@ -8,6 +8,7 @@ import ( "bytes" "cmp" "context" + "encoding/binary" "fmt" "io" "math" @@ -322,15 +323,8 @@ func (ks *defaultKeySeeker) MaterializeUserKey(keyIter *PrefixBytesIter, prevRow ks.prefixes.SetAt(keyIter, row) } suffix := ks.suffixes.At(row) - n := keyIter.len + len(suffix) - if keyIter.cap < n { - keyIter.cap = n << 1 - prevPtr := keyIter.ptr - keyIter.ptr = mallocgc(uintptr(keyIter.cap), nil, false) - memmove(keyIter.ptr, prevPtr, uintptr(keyIter.len)) - } memmove(unsafe.Pointer(uintptr(keyIter.ptr)+uintptr(keyIter.len)), unsafe.Pointer(unsafe.SliceData(suffix)), uintptr(len(suffix))) - return unsafe.Slice((*byte)(keyIter.ptr), n) + return unsafe.Slice((*byte)(keyIter.ptr), keyIter.len+len(suffix)) } func (ks *defaultKeySeeker) Release() { @@ -358,9 +352,10 @@ type DataBlockWriter struct { // that indicates when a value is stored out-of-band in a value block. isValueExternal BitmapBuilder - enc blockEncoder - rows int - valuePrefixTmp [1]byte + enc blockEncoder + rows int + maximumKeyLength int + valuePrefixTmp [1]byte } // TODO(jackson): Add an isObsolete bitmap column. @@ -373,6 +368,12 @@ const ( dataBlockColumnMax ) +// The data block header is a 4-byte uint32 encoding the maximum length of a key +// contained within the block. This is used by iterators to avoid the need to +// grow key buffers while iterating over the block, ensuring that the key buffer +// is always sufficiently large. +const dataBlockCustomHeaderSize = 4 + // Init initializes the data block writer. func (w *DataBlockWriter) Init(schema KeySchema) { w.Schema = schema @@ -382,6 +383,7 @@ func (w *DataBlockWriter) Init(schema KeySchema) { w.values.Init() w.isValueExternal.Reset() w.rows = 0 + w.maximumKeyLength = 0 } // Reset resets the data block writer to its initial state, retaining buffers. @@ -392,6 +394,7 @@ func (w *DataBlockWriter) Reset() { w.values.Reset() w.isValueExternal.Reset() w.rows = 0 + w.maximumKeyLength = 0 w.enc.reset() } @@ -447,6 +450,9 @@ func (w *DataBlockWriter) Add( // bitmap and know there is no value prefix byte if !isValueExternal. w.values.Put(value) } + if len(ikey.UserKey) > int(w.maximumKeyLength) { + w.maximumKeyLength = len(ikey.UserKey) + } w.rows++ } @@ -457,7 +463,7 @@ func (w *DataBlockWriter) Rows() int { // Size returns the size of the current pending data block. func (w *DataBlockWriter) Size() int { - off := blockHeaderSize(len(w.Schema.ColumnTypes)+dataBlockColumnMax, 0) + off := blockHeaderSize(len(w.Schema.ColumnTypes)+dataBlockColumnMax, dataBlockCustomHeaderSize) off = w.KeyWriter.Size(w.rows, off) off = w.trailers.Size(w.rows, off) off = w.prefixSame.Size(w.rows, off) @@ -475,7 +481,10 @@ func (w *DataBlockWriter) Finish() []byte { Columns: uint16(cols), Rows: uint32(w.rows), } - w.enc.init(w.Size(), h, 0) + w.enc.init(w.Size(), h, dataBlockCustomHeaderSize) + + // Write the max key length in the custom header. + binary.LittleEndian.PutUint32(w.enc.data()[:dataBlockCustomHeaderSize], uint32(w.maximumKeyLength)) // Write the user-defined key columns. w.enc.encode(w.rows, w.KeyWriter) @@ -519,6 +528,10 @@ type DataBlockReader struct { // true, the value contains a ValuePrefix byte followed by an encoded value // handle indicating the value's location within the value block(s). isValueExternal Bitmap + // maximumKeyLength is the maximum length of a user key in the block. + // Iterators may use it to allocate a sufficiently large buffer up front, + // and elide size checks during iteration. + maximumKeyLength uint32 } // BlockReader returns a pointer to the underlying BlockReader. @@ -528,14 +541,17 @@ func (r *DataBlockReader) BlockReader() *BlockReader { // Init initializes the data block reader with the given serialized data block. func (r *DataBlockReader) Init(schema KeySchema, data []byte) { - r.r.Init(data, 0) + r.r.Init(data, dataBlockCustomHeaderSize) r.trailers = r.r.Uint64s(len(schema.ColumnTypes) + dataBlockColumnTrailer) r.prefixChanged = r.r.Bitmap(len(schema.ColumnTypes) + dataBlockColumnPrefixChanged) r.values = r.r.RawBytes(len(schema.ColumnTypes) + dataBlockColumnValue) r.isValueExternal = r.r.Bitmap(len(schema.ColumnTypes) + dataBlockColumnIsValueExternal) + r.maximumKeyLength = binary.LittleEndian.Uint32(data[:dataBlockCustomHeaderSize]) } func (r *DataBlockReader) toFormatter(f *binfmt.Formatter) { + f.CommentLine("data block header") + f.HexBytesln(4, "maximum key length: %d", r.maximumKeyLength) r.r.headerToBinFormatter(f) for i := 0; i < int(r.r.header.Columns); i++ { r.r.columnToBinFormatter(f, i, int(r.r.header.Rows)) @@ -572,6 +588,9 @@ func (i *DataBlockIter) Init( kv: base.InternalKV{}, keyIter: PrefixBytesIter{}, } + // Allocate a keyIter buffer that's large enough to hold the largest user + // key in the block. + i.keyIter.Alloc(int(r.maximumKeyLength)) return i.keySeeker.Init(r) } diff --git a/sstable/colblk/prefix_bytes.go b/sstable/colblk/prefix_bytes.go index 47126979ce..e9bc44470d 100644 --- a/sstable/colblk/prefix_bytes.go +++ b/sstable/colblk/prefix_bytes.go @@ -250,7 +250,9 @@ type PrefixBytesIter struct { } // SetAt updates the provided PrefixBytesIter to hold the i'th []byte slice in -// the PrefixBytes. +// the PrefixBytes. The PrefixBytesIter's buffer must be sufficiently large to +// hold the i'th []byte slice, and the caller is required to statically ensure +// this. func (b *PrefixBytes) SetAt(it *PrefixBytesIter, i int) { // Determine the offset and length of the bundle prefix. bundleOffsetIndex := b.bundleOffsetIndexForRow(i) @@ -268,8 +270,7 @@ func (b *PrefixBytes) SetAt(it *PrefixBytesIter, i int) { // Grow the size of the iterator's buffer if necessary. it.len = b.sharedPrefixLen + int(it.bundlePrefixLen) + int(rowSuffixEnd-rowSuffixStart) if it.len > it.cap { - it.cap = it.len << 1 - it.ptr = mallocgc(uintptr(it.cap), nil, false) + panic(errors.AssertionFailedf("buffer too small: %d > %d", it.len, it.cap)) } // Copy the shared key prefix. @@ -291,7 +292,9 @@ func (b *PrefixBytes) SetAt(it *PrefixBytesIter, i int) { // SetNext updates the provided PrefixBytesIter to hold the next []byte slice in // the PrefixBytes. SetNext requires the provided iter to currently hold a slice -// and for a subsequent slice to exist within the PrefixBytes. +// and for a subsequent slice to exist within the PrefixBytes. The +// PrefixBytesIter's buffer must be sufficiently large to hold the next []byte +// slice, and the caller is required to statically ensure this. func (b *PrefixBytes) SetNext(it *PrefixBytesIter) { it.offsetIndex++ // If the next row is in the same bundle, we can take a fast path of only @@ -308,10 +311,7 @@ func (b *PrefixBytes) SetNext(it *PrefixBytesIter) { // Grow the buffer if necessary. it.len = b.sharedPrefixLen + int(it.bundlePrefixLen) + int(rowSuffixEnd-rowSuffixStart) if it.len > it.cap { - it.cap = it.len << 1 - prevPtr := it.ptr - it.ptr = mallocgc(uintptr(it.cap), nil, false) - memmove(it.ptr, prevPtr, uintptr(b.sharedPrefixLen)+uintptr(it.bundlePrefixLen)) + panic(errors.AssertionFailedf("buffer too small: %d > %d", it.len, it.cap)) } // Copy in the per-row suffix. memmove( @@ -337,9 +337,7 @@ func (b *PrefixBytes) SetNext(it *PrefixBytesIter) { // Grow the buffer if necessary. it.len = b.sharedPrefixLen + int(it.bundlePrefixLen) + int(rowSuffixEnd-rowSuffixStart) if it.len > it.cap { - it.cap = it.len << 1 - it.ptr = mallocgc(uintptr(it.cap), nil, false) - memmove(it.ptr, b.rawBytes.data, uintptr(b.sharedPrefixLen)) + panic(errors.AssertionFailedf("buffer too small: %d > %d", it.len, it.cap)) } // Copy in the new bundle suffix. memmove( diff --git a/sstable/colblk/prefix_bytes_test.go b/sstable/colblk/prefix_bytes_test.go index adae5b790e..d2cfefb935 100644 --- a/sstable/colblk/prefix_bytes_test.go +++ b/sstable/colblk/prefix_bytes_test.go @@ -275,6 +275,7 @@ func BenchmarkPrefixBytes(b *testing.B) { pb, _ := DecodePrefixBytes(buf, 0, n) b.ResetTimer() var pbi PrefixBytesIter + pbi.Alloc(maxLen) for i := 0; i < b.N; i++ { j := i % n if j == 0 { diff --git a/sstable/colblk/testdata/data_block/bundle_search b/sstable/colblk/testdata/data_block/bundle_search index 88c503024b..addcdaa6e9 100644 --- a/sstable/colblk/testdata/data_block/bundle_search +++ b/sstable/colblk/testdata/data_block/bundle_search @@ -96,283 +96,285 @@ size=761: finish ---- +# data block header +000-004: x 10000000 # maximum key length: 16 # columnar block header -000-001: x 01 # version 1 -001-003: x 0600 # 6 columns -003-007: x 42000000 # 66 rows +004-005: x 01 # version 1 +005-007: x 0600 # 6 columns +007-011: x 42000000 # 66 rows # column 0 -007-008: b 00000111 # prefixbytes -008-012: x 25000000 # page start 37 +011-012: b 00000111 # prefixbytes +012-016: x 29000000 # page start 41 # column 1 -012-013: b 00000110 # bytes -013-017: x 25020000 # page start 549 +016-017: b 00000110 # bytes +017-021: x 29020000 # page start 553 # column 2 -017-018: b 00000101 # uint64 -018-022: x 2a020000 # page start 554 +021-022: b 00000101 # uint64 +022-026: x 2e020000 # page start 558 # column 3 -022-023: b 00000001 # bool -023-027: x 33020000 # page start 563 +026-027: b 00000001 # bool +027-031: x 37020000 # page start 567 # column 4 -027-028: b 00000110 # bytes -028-032: x 50020000 # page start 592 +031-032: b 00000110 # bytes +032-036: x 50020000 # page start 592 # column 5 -032-033: b 00000001 # bool -033-037: x da020000 # page start 730 +036-037: b 00000001 # bool +037-041: x da020000 # page start 730 # data for column 0 # PrefixBytes -037-038: x 02 # bundleSize: 4 +041-042: x 02 # bundleSize: 4 # Offsets table -038-039: x 03 # delta encoding: delta16 -039-043: x 00000000 # 32-bit constant: 0 +042-043: x 03 # delta encoding: delta16 +043-047: x 00000000 # 32-bit constant: 0 # padding -043-044: x 00 # aligning to 16-bit boundary -044-046: x 0200 # data[0] = 2 [214 overall] -046-048: x 0300 # data[1] = 3 [215 overall] -048-050: x 0400 # data[2] = 4 [216 overall] -050-052: x 0700 # data[3] = 7 [219 overall] -052-054: x 0e00 # data[4] = 14 [226 overall] -054-056: x 1200 # data[5] = 18 [230 overall] -056-058: x 1500 # data[6] = 21 [233 overall] -058-060: x 1a00 # data[7] = 26 [238 overall] -060-062: x 1d00 # data[8] = 29 [241 overall] -062-064: x 2200 # data[9] = 34 [246 overall] -064-066: x 2500 # data[10] = 37 [249 overall] -066-068: x 2600 # data[11] = 38 [250 overall] -068-070: x 2d00 # data[12] = 45 [257 overall] -070-072: x 3000 # data[13] = 48 [260 overall] -072-074: x 3100 # data[14] = 49 [261 overall] -074-076: x 3400 # data[15] = 52 [264 overall] -076-078: x 3500 # data[16] = 53 [265 overall] -078-080: x 3b00 # data[17] = 59 [271 overall] -080-082: x 4100 # data[18] = 65 [277 overall] -082-084: x 4600 # data[19] = 70 [282 overall] -084-086: x 4700 # data[20] = 71 [283 overall] -086-088: x 4900 # data[21] = 73 [285 overall] -088-090: x 4c00 # data[22] = 76 [288 overall] -090-092: x 5000 # data[23] = 80 [292 overall] -092-094: x 5500 # data[24] = 85 [297 overall] -094-096: x 5800 # data[25] = 88 [300 overall] -096-098: x 5a00 # data[26] = 90 [302 overall] -098-100: x 5f00 # data[27] = 95 [307 overall] -100-102: x 6600 # data[28] = 102 [314 overall] -102-104: x 6900 # data[29] = 105 [317 overall] -104-106: x 6d00 # data[30] = 109 [321 overall] -106-108: x 7400 # data[31] = 116 [328 overall] -108-110: x 7400 # data[32] = 116 [328 overall] -110-112: x 7700 # data[33] = 119 [331 overall] -112-114: x 7d00 # data[34] = 125 [337 overall] -114-116: x 8200 # data[35] = 130 [342 overall] -116-118: x 8300 # data[36] = 131 [343 overall] -118-120: x 8c00 # data[37] = 140 [352 overall] -120-122: x 9900 # data[38] = 153 [365 overall] -122-124: x a200 # data[39] = 162 [374 overall] -124-126: x a300 # data[40] = 163 [375 overall] -126-128: x a500 # data[41] = 165 [377 overall] -128-130: x a900 # data[42] = 169 [381 overall] -130-132: x ad00 # data[43] = 173 [385 overall] -132-134: x b200 # data[44] = 178 [390 overall] -134-136: x ba00 # data[45] = 186 [398 overall] -136-138: x bc00 # data[46] = 188 [400 overall] -138-140: x c100 # data[47] = 193 [405 overall] -140-142: x c600 # data[48] = 198 [410 overall] -142-144: x ca00 # data[49] = 202 [414 overall] -144-146: x ce00 # data[50] = 206 [418 overall] -146-148: x d000 # data[51] = 208 [420 overall] -148-150: x d400 # data[52] = 212 [424 overall] -150-152: x d600 # data[53] = 214 [426 overall] -152-154: x db00 # data[54] = 219 [431 overall] -154-156: x df00 # data[55] = 223 [435 overall] -156-158: x e100 # data[56] = 225 [437 overall] -158-160: x e500 # data[57] = 229 [441 overall] -160-162: x eb00 # data[58] = 235 [447 overall] -162-164: x f100 # data[59] = 241 [453 overall] -164-166: x f700 # data[60] = 247 [459 overall] -166-168: x fd00 # data[61] = 253 [465 overall] -168-170: x fd00 # data[62] = 253 [465 overall] -170-172: x ff00 # data[63] = 255 [467 overall] -172-174: x 0301 # data[64] = 259 [471 overall] -174-176: x 0901 # data[65] = 265 [477 overall] -176-178: x 0b01 # data[66] = 267 [479 overall] -178-180: x 1001 # data[67] = 272 [484 overall] -180-182: x 1401 # data[68] = 276 [488 overall] -182-184: x 1901 # data[69] = 281 [493 overall] -184-186: x 1e01 # data[70] = 286 [498 overall] -186-188: x 2001 # data[71] = 288 [500 overall] -188-190: x 2501 # data[72] = 293 [505 overall] -190-192: x 2901 # data[73] = 297 [509 overall] -192-194: x 2f01 # data[74] = 303 [515 overall] -194-196: x 3401 # data[75] = 308 [520 overall] -196-198: x 3601 # data[76] = 310 [522 overall] -198-200: x 3801 # data[77] = 312 [524 overall] -200-202: x 3c01 # data[78] = 316 [528 overall] -202-204: x 4101 # data[79] = 321 [533 overall] -204-206: x 4501 # data[80] = 325 [537 overall] -206-208: x 4601 # data[81] = 326 [538 overall] -208-210: x 4c01 # data[82] = 332 [544 overall] -210-212: x 5101 # data[83] = 337 [549 overall] +047-048: x 00 # aligning to 16-bit boundary +048-050: x 0200 # data[0] = 2 [218 overall] +050-052: x 0300 # data[1] = 3 [219 overall] +052-054: x 0400 # data[2] = 4 [220 overall] +054-056: x 0700 # data[3] = 7 [223 overall] +056-058: x 0e00 # data[4] = 14 [230 overall] +058-060: x 1200 # data[5] = 18 [234 overall] +060-062: x 1500 # data[6] = 21 [237 overall] +062-064: x 1a00 # data[7] = 26 [242 overall] +064-066: x 1d00 # data[8] = 29 [245 overall] +066-068: x 2200 # data[9] = 34 [250 overall] +068-070: x 2500 # data[10] = 37 [253 overall] +070-072: x 2600 # data[11] = 38 [254 overall] +072-074: x 2d00 # data[12] = 45 [261 overall] +074-076: x 3000 # data[13] = 48 [264 overall] +076-078: x 3100 # data[14] = 49 [265 overall] +078-080: x 3400 # data[15] = 52 [268 overall] +080-082: x 3500 # data[16] = 53 [269 overall] +082-084: x 3b00 # data[17] = 59 [275 overall] +084-086: x 4100 # data[18] = 65 [281 overall] +086-088: x 4600 # data[19] = 70 [286 overall] +088-090: x 4700 # data[20] = 71 [287 overall] +090-092: x 4900 # data[21] = 73 [289 overall] +092-094: x 4c00 # data[22] = 76 [292 overall] +094-096: x 5000 # data[23] = 80 [296 overall] +096-098: x 5500 # data[24] = 85 [301 overall] +098-100: x 5800 # data[25] = 88 [304 overall] +100-102: x 5a00 # data[26] = 90 [306 overall] +102-104: x 5f00 # data[27] = 95 [311 overall] +104-106: x 6600 # data[28] = 102 [318 overall] +106-108: x 6900 # data[29] = 105 [321 overall] +108-110: x 6d00 # data[30] = 109 [325 overall] +110-112: x 7400 # data[31] = 116 [332 overall] +112-114: x 7400 # data[32] = 116 [332 overall] +114-116: x 7700 # data[33] = 119 [335 overall] +116-118: x 7d00 # data[34] = 125 [341 overall] +118-120: x 8200 # data[35] = 130 [346 overall] +120-122: x 8300 # data[36] = 131 [347 overall] +122-124: x 8c00 # data[37] = 140 [356 overall] +124-126: x 9900 # data[38] = 153 [369 overall] +126-128: x a200 # data[39] = 162 [378 overall] +128-130: x a300 # data[40] = 163 [379 overall] +130-132: x a500 # data[41] = 165 [381 overall] +132-134: x a900 # data[42] = 169 [385 overall] +134-136: x ad00 # data[43] = 173 [389 overall] +136-138: x b200 # data[44] = 178 [394 overall] +138-140: x ba00 # data[45] = 186 [402 overall] +140-142: x bc00 # data[46] = 188 [404 overall] +142-144: x c100 # data[47] = 193 [409 overall] +144-146: x c600 # data[48] = 198 [414 overall] +146-148: x ca00 # data[49] = 202 [418 overall] +148-150: x ce00 # data[50] = 206 [422 overall] +150-152: x d000 # data[51] = 208 [424 overall] +152-154: x d400 # data[52] = 212 [428 overall] +154-156: x d600 # data[53] = 214 [430 overall] +156-158: x db00 # data[54] = 219 [435 overall] +158-160: x df00 # data[55] = 223 [439 overall] +160-162: x e100 # data[56] = 225 [441 overall] +162-164: x e500 # data[57] = 229 [445 overall] +164-166: x eb00 # data[58] = 235 [451 overall] +166-168: x f100 # data[59] = 241 [457 overall] +168-170: x f700 # data[60] = 247 [463 overall] +170-172: x fd00 # data[61] = 253 [469 overall] +172-174: x fd00 # data[62] = 253 [469 overall] +174-176: x ff00 # data[63] = 255 [471 overall] +176-178: x 0301 # data[64] = 259 [475 overall] +178-180: x 0901 # data[65] = 265 [481 overall] +180-182: x 0b01 # data[66] = 267 [483 overall] +182-184: x 1001 # data[67] = 272 [488 overall] +184-186: x 1401 # data[68] = 276 [492 overall] +186-188: x 1901 # data[69] = 281 [497 overall] +188-190: x 1e01 # data[70] = 286 [502 overall] +190-192: x 2001 # data[71] = 288 [504 overall] +192-194: x 2501 # data[72] = 293 [509 overall] +194-196: x 2901 # data[73] = 297 [513 overall] +196-198: x 2f01 # data[74] = 303 [519 overall] +198-200: x 3401 # data[75] = 308 [524 overall] +200-202: x 3601 # data[76] = 310 [526 overall] +202-204: x 3801 # data[77] = 312 [528 overall] +204-206: x 3c01 # data[78] = 316 [532 overall] +206-208: x 4101 # data[79] = 321 [537 overall] +208-210: x 4501 # data[80] = 325 [541 overall] +210-212: x 4601 # data[81] = 326 [542 overall] +212-214: x 4c01 # data[82] = 332 [548 overall] +214-216: x 5101 # data[83] = 337 [553 overall] # Data -212-214: x 6261 # data[00]: ba (block prefix) -214-215: x 62 # data[01]: ..b (bundle prefix) -215-216: x 61 # data[02]: ...a -216-219: x 626c65 # data[03]: ...ble -219-226: x 626c656d656e74 # data[04]: ...blement -226-230: x 626c6572 # data[05]: ...bler -230-233: x 62626c # data[06]: ..bbl (bundle prefix) -233-238: x 65736f6d65 # data[07]: .....esome -238-241: x 696e67 # data[08]: .....ing -241-246: x 696e676c79 # data[09]: .....ingly -246-249: x 697368 # data[10]: .....ish -249-250: x 62 # data[11]: ..b (bundle prefix) -250-257: x 626c6973686c79 # data[12]: ...blishly -257-260: x 626c79 # data[13]: ...bly -260-261: x 65 # data[14]: ...e -261-264: x 6f6f6e # data[15]: ...oon -264-265: x 62 # data[16]: ..b (bundle prefix) -265-271: x 6f6f6e657279 # data[17]: ...oonery -271-277: x 6f6f6e697368 # data[18]: ...oonish -277-282: x 7573686b61 # data[19]: ...ushka -282-283: x 79 # data[20]: ...y -283-285: x 6279 # data[21]: ..by (bundle prefix) -285-288: x 646f6d # data[22]: ....dom -288-292: x 686f6f64 # data[23]: ....hood -292-297: x 686f757365 # data[24]: ....house -297-300: x 697368 # data[25]: ....ish -300-302: x 6279 # data[26]: ..by (bundle prefix) -302-307: x 6973686c79 # data[27]: ....ishly -307-314: x 6973686e657373 # data[28]: ....ishness -314-317: x 69736d # data[29]: ....ism -317-321: x 6c696b65 # data[30]: ....like -321-328: x 636368616e616c # data[31]: ..cchanal (bundle prefix) -328-328: x # data[32]: ......... -328-331: x 69616e # data[33]: .........ian -331-337: x 69616e69736d # data[34]: .........ianism -337-342: x 69616e6c79 # data[35]: .........ianly -342-343: x 63 # data[36]: ..c (bundle prefix) -343-352: x 6368616e616c69736d # data[37]: ...chanalism -352-362: x 6368616e616c697a6174 # data[38]: ...chanalization -362-365: x 696f6e # (continued...) -365-374: x 6368616e616c697a65 # data[39]: ...chanalize -374-375: x 6b # data[40]: ...k -375-377: x 636b # data[41]: ..ck (bundle prefix) -377-381: x 61636865 # data[42]: ....ache -381-385: x 626f6e65 # data[43]: ....bone -385-390: x 626f6e6564 # data[44]: ....boned -390-398: x 627265616b696e67 # data[45]: ....breaking -398-400: x 636b # data[46]: ..ck (bundle prefix) -400-405: x 636f757274 # data[47]: ....court -405-410: x 63726f7373 # data[48]: ....cross -410-414: x 646f6f72 # data[49]: ....door -414-418: x 646f776e # data[50]: ....down -418-420: x 636b # data[51]: ..ck (bundle prefix) -420-424: x 64726f70 # data[52]: ....drop -424-426: x 6564 # data[53]: ....ed -426-431: x 6669656c64 # data[54]: ....field -431-435: x 66696c6c # data[55]: ....fill -435-437: x 636b # data[56]: ..ck (bundle prefix) -437-441: x 66697265 # data[57]: ....fire -441-447: x 666972696e67 # data[58]: ....firing -447-453: x 67616d6d6f6e # data[59]: ....gammon -453-459: x 67726f756e64 # data[60]: ....ground -459-465: x 636b68616e64 # data[61]: ..ckhand (bundle prefix) -465-465: x # data[62]: ........ -465-467: x 6564 # data[63]: ........ed -467-471: x 65646c79 # data[64]: ........edly -471-477: x 65646e657373 # data[65]: ........edness -477-479: x 636b # data[66]: ..ck (bundle prefix) -479-484: x 706564616c # data[67]: ....pedal -484-488: x 736c6170 # data[68]: ....slap -488-493: x 736c696465 # data[69]: ....slide -493-498: x 7370616365 # data[70]: ....space -498-500: x 636b # data[71]: ..ck (bundle prefix) -500-505: x 7374616765 # data[72]: ....stage -505-509: x 73746f70 # data[73]: ....stop -509-515: x 7374726f6b65 # data[74]: ....stroke -515-520: x 747261636b # data[75]: ....track -520-522: x 636b # data[76]: ..ck (bundle prefix) -522-524: x 7570 # data[77]: ....up -524-528: x 77617264 # data[78]: ....ward -528-533: x 7761726473 # data[79]: ....wards -533-537: x 77617368 # data[80]: ....wash -537-538: x 63 # data[81]: ..c (bundle prefix) -538-544: x 6b776f6f6473 # data[82]: ...kwoods -544-549: x 7465726961 # data[83]: ...teria +216-218: x 6261 # data[00]: ba (block prefix) +218-219: x 62 # data[01]: ..b (bundle prefix) +219-220: x 61 # data[02]: ...a +220-223: x 626c65 # data[03]: ...ble +223-230: x 626c656d656e74 # data[04]: ...blement +230-234: x 626c6572 # data[05]: ...bler +234-237: x 62626c # data[06]: ..bbl (bundle prefix) +237-242: x 65736f6d65 # data[07]: .....esome +242-245: x 696e67 # data[08]: .....ing +245-250: x 696e676c79 # data[09]: .....ingly +250-253: x 697368 # data[10]: .....ish +253-254: x 62 # data[11]: ..b (bundle prefix) +254-261: x 626c6973686c79 # data[12]: ...blishly +261-264: x 626c79 # data[13]: ...bly +264-265: x 65 # data[14]: ...e +265-268: x 6f6f6e # data[15]: ...oon +268-269: x 62 # data[16]: ..b (bundle prefix) +269-275: x 6f6f6e657279 # data[17]: ...oonery +275-281: x 6f6f6e697368 # data[18]: ...oonish +281-286: x 7573686b61 # data[19]: ...ushka +286-287: x 79 # data[20]: ...y +287-289: x 6279 # data[21]: ..by (bundle prefix) +289-292: x 646f6d # data[22]: ....dom +292-296: x 686f6f64 # data[23]: ....hood +296-301: x 686f757365 # data[24]: ....house +301-304: x 697368 # data[25]: ....ish +304-306: x 6279 # data[26]: ..by (bundle prefix) +306-311: x 6973686c79 # data[27]: ....ishly +311-318: x 6973686e657373 # data[28]: ....ishness +318-321: x 69736d # data[29]: ....ism +321-325: x 6c696b65 # data[30]: ....like +325-332: x 636368616e616c # data[31]: ..cchanal (bundle prefix) +332-332: x # data[32]: ......... +332-335: x 69616e # data[33]: .........ian +335-341: x 69616e69736d # data[34]: .........ianism +341-346: x 69616e6c79 # data[35]: .........ianly +346-347: x 63 # data[36]: ..c (bundle prefix) +347-356: x 6368616e616c69736d # data[37]: ...chanalism +356-366: x 6368616e616c697a6174 # data[38]: ...chanalization +366-369: x 696f6e # (continued...) +369-378: x 6368616e616c697a65 # data[39]: ...chanalize +378-379: x 6b # data[40]: ...k +379-381: x 636b # data[41]: ..ck (bundle prefix) +381-385: x 61636865 # data[42]: ....ache +385-389: x 626f6e65 # data[43]: ....bone +389-394: x 626f6e6564 # data[44]: ....boned +394-402: x 627265616b696e67 # data[45]: ....breaking +402-404: x 636b # data[46]: ..ck (bundle prefix) +404-409: x 636f757274 # data[47]: ....court +409-414: x 63726f7373 # data[48]: ....cross +414-418: x 646f6f72 # data[49]: ....door +418-422: x 646f776e # data[50]: ....down +422-424: x 636b # data[51]: ..ck (bundle prefix) +424-428: x 64726f70 # data[52]: ....drop +428-430: x 6564 # data[53]: ....ed +430-435: x 6669656c64 # data[54]: ....field +435-439: x 66696c6c # data[55]: ....fill +439-441: x 636b # data[56]: ..ck (bundle prefix) +441-445: x 66697265 # data[57]: ....fire +445-451: x 666972696e67 # data[58]: ....firing +451-457: x 67616d6d6f6e # data[59]: ....gammon +457-463: x 67726f756e64 # data[60]: ....ground +463-469: x 636b68616e64 # data[61]: ..ckhand (bundle prefix) +469-469: x # data[62]: ........ +469-471: x 6564 # data[63]: ........ed +471-475: x 65646c79 # data[64]: ........edly +475-481: x 65646e657373 # data[65]: ........edness +481-483: x 636b # data[66]: ..ck (bundle prefix) +483-488: x 706564616c # data[67]: ....pedal +488-492: x 736c6170 # data[68]: ....slap +492-497: x 736c696465 # data[69]: ....slide +497-502: x 7370616365 # data[70]: ....space +502-504: x 636b # data[71]: ..ck (bundle prefix) +504-509: x 7374616765 # data[72]: ....stage +509-513: x 73746f70 # data[73]: ....stop +513-519: x 7374726f6b65 # data[74]: ....stroke +519-524: x 747261636b # data[75]: ....track +524-526: x 636b # data[76]: ..ck (bundle prefix) +526-528: x 7570 # data[77]: ....up +528-532: x 77617264 # data[78]: ....ward +532-537: x 7761726473 # data[79]: ....wards +537-541: x 77617368 # data[80]: ....wash +541-542: x 63 # data[81]: ..c (bundle prefix) +542-548: x 6b776f6f6473 # data[82]: ...kwoods +548-553: x 7465726961 # data[83]: ...teria # data for column 1 # rawbytes # offsets table -549-550: x 01 # delta encoding: const -550-554: x 00000000 # 32-bit constant: 0 +553-554: x 01 # delta encoding: const +554-558: x 00000000 # 32-bit constant: 0 # data -554-554: x # data[0]: -554-554: x # data[1]: -554-554: x # data[2]: -554-554: x # data[3]: -554-554: x # data[4]: -554-554: x # data[5]: -554-554: x # data[6]: -554-554: x # data[7]: -554-554: x # data[8]: -554-554: x # data[9]: -554-554: x # data[10]: -554-554: x # data[11]: -554-554: x # data[12]: -554-554: x # data[13]: -554-554: x # data[14]: -554-554: x # data[15]: -554-554: x # data[16]: -554-554: x # data[17]: -554-554: x # data[18]: -554-554: x # data[19]: -554-554: x # data[20]: -554-554: x # data[21]: -554-554: x # data[22]: -554-554: x # data[23]: -554-554: x # data[24]: -554-554: x # data[25]: -554-554: x # data[26]: -554-554: x # data[27]: -554-554: x # data[28]: -554-554: x # data[29]: -554-554: x # data[30]: -554-554: x # data[31]: -554-554: x # data[32]: -554-554: x # data[33]: -554-554: x # data[34]: -554-554: x # data[35]: -554-554: x # data[36]: -554-554: x # data[37]: -554-554: x # data[38]: -554-554: x # data[39]: -554-554: x # data[40]: -554-554: x # data[41]: -554-554: x # data[42]: -554-554: x # data[43]: -554-554: x # data[44]: -554-554: x # data[45]: -554-554: x # data[46]: -554-554: x # data[47]: -554-554: x # data[48]: -554-554: x # data[49]: -554-554: x # data[50]: -554-554: x # data[51]: -554-554: x # data[52]: -554-554: x # data[53]: -554-554: x # data[54]: -554-554: x # data[55]: -554-554: x # data[56]: -554-554: x # data[57]: -554-554: x # data[58]: -554-554: x # data[59]: -554-554: x # data[60]: -554-554: x # data[61]: -554-554: x # data[62]: -554-554: x # data[63]: -554-554: x # data[64]: -554-554: x # data[65]: +558-558: x # data[0]: +558-558: x # data[1]: +558-558: x # data[2]: +558-558: x # data[3]: +558-558: x # data[4]: +558-558: x # data[5]: +558-558: x # data[6]: +558-558: x # data[7]: +558-558: x # data[8]: +558-558: x # data[9]: +558-558: x # data[10]: +558-558: x # data[11]: +558-558: x # data[12]: +558-558: x # data[13]: +558-558: x # data[14]: +558-558: x # data[15]: +558-558: x # data[16]: +558-558: x # data[17]: +558-558: x # data[18]: +558-558: x # data[19]: +558-558: x # data[20]: +558-558: x # data[21]: +558-558: x # data[22]: +558-558: x # data[23]: +558-558: x # data[24]: +558-558: x # data[25]: +558-558: x # data[26]: +558-558: x # data[27]: +558-558: x # data[28]: +558-558: x # data[29]: +558-558: x # data[30]: +558-558: x # data[31]: +558-558: x # data[32]: +558-558: x # data[33]: +558-558: x # data[34]: +558-558: x # data[35]: +558-558: x # data[36]: +558-558: x # data[37]: +558-558: x # data[38]: +558-558: x # data[39]: +558-558: x # data[40]: +558-558: x # data[41]: +558-558: x # data[42]: +558-558: x # data[43]: +558-558: x # data[44]: +558-558: x # data[45]: +558-558: x # data[46]: +558-558: x # data[47]: +558-558: x # data[48]: +558-558: x # data[49]: +558-558: x # data[50]: +558-558: x # data[51]: +558-558: x # data[52]: +558-558: x # data[53]: +558-558: x # data[54]: +558-558: x # data[55]: +558-558: x # data[56]: +558-558: x # data[57]: +558-558: x # data[58]: +558-558: x # data[59]: +558-558: x # data[60]: +558-558: x # data[61]: +558-558: x # data[62]: +558-558: x # data[63]: +558-558: x # data[64]: +558-558: x # data[65]: # data for column 2 -554-555: x 01 # delta encoding: const -555-563: x 0101000000000000 # 64-bit constant: 257 +558-559: x 01 # delta encoding: const +559-567: x 0101000000000000 # 64-bit constant: 257 # data for column 3 -563-568: x 0000000000 # padding to align to 64-bit boundary +567-568: x 00 # padding to align to 64-bit boundary 568-576: b 1111111111111111111111111111111111111111111111111111111111111111 # bitmap word 0 576-584: b 0000001100000000000000000000000000000000000000000000000000000000 # bitmap word 1 584-592: b 0000001100000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 diff --git a/sstable/colblk/testdata/data_block/external_value b/sstable/colblk/testdata/data_block/external_value index 6d5aa206b9..fe9b689e1c 100644 --- a/sstable/colblk/testdata/data_block/external_value +++ b/sstable/colblk/testdata/data_block/external_value @@ -30,7 +30,7 @@ blockprefix_kiwi@99#0,SET:valueHandle-kiwi99 blockprefix_kiwi@98#0,SET:valueHandle-kiwi98 blockprefix_lemon@92#0,DEL: ---- -size=657: +size=665: 0: prefixes: prefixbytes(16): 20 keys 1: suffixes: bytes: 20 rows set; 54 bytes in data 2: trailers: uint64: 20 rows @@ -40,232 +40,235 @@ size=657: finish ---- +# data block header +000-004: x 16000000 # maximum key length: 22 # columnar block header -000-001: x 01 # version 1 -001-003: x 0600 # 6 columns -003-007: x 14000000 # 20 rows +004-005: x 01 # version 1 +005-007: x 0600 # 6 columns +007-011: x 14000000 # 20 rows # column 0 -007-008: b 00000111 # prefixbytes -008-012: x 25000000 # page start 37 +011-012: b 00000111 # prefixbytes +012-016: x 29000000 # page start 41 # column 1 -012-013: b 00000110 # bytes -013-017: x 6e000000 # page start 110 +016-017: b 00000110 # bytes +017-021: x 72000000 # page start 114 # column 2 -017-018: b 00000101 # uint64 -018-022: x be000000 # page start 190 +021-022: b 00000101 # uint64 +022-026: x c2000000 # page start 194 # column 3 -022-023: b 00000001 # bool -023-027: x f0000000 # page start 240 +026-027: b 00000001 # bool +027-031: x f4000000 # page start 244 # column 4 -027-028: b 00000110 # bytes -028-032: x 00010000 # page start 256 +031-032: b 00000110 # bytes +032-036: x 08010000 # page start 264 # column 5 -032-033: b 00000001 # bool -033-037: x 7b020000 # page start 635 +036-037: b 00000001 # bool +037-041: x 83020000 # page start 643 # data for column 0 # PrefixBytes -037-038: x 04 # bundleSize: 16 +041-042: x 04 # bundleSize: 16 # Offsets table -038-039: x 02 # delta encoding: delta8 -039-043: x 00000000 # 32-bit constant: 0 -043-044: x 0c # data[0] = 12 [78 overall] -044-045: x 0c # data[1] = 12 [78 overall] -045-046: x 11 # data[2] = 17 [83 overall] -046-047: x 11 # data[3] = 17 [83 overall] -047-048: x 11 # data[4] = 17 [83 overall] -048-049: x 11 # data[5] = 17 [83 overall] -049-050: x 17 # data[6] = 23 [89 overall] -050-051: x 17 # data[7] = 23 [89 overall] -051-052: x 17 # data[8] = 23 [89 overall] -052-053: x 17 # data[9] = 23 [89 overall] -053-054: x 17 # data[10] = 23 [89 overall] -054-055: x 17 # data[11] = 23 [89 overall] -055-056: x 1e # data[12] = 30 [96 overall] -056-057: x 1e # data[13] = 30 [96 overall] -057-058: x 1e # data[14] = 30 [96 overall] -058-059: x 1e # data[15] = 30 [96 overall] -059-060: x 1e # data[16] = 30 [96 overall] -060-061: x 1e # data[17] = 30 [96 overall] -061-062: x 1e # data[18] = 30 [96 overall] -062-063: x 23 # data[19] = 35 [101 overall] -063-064: x 27 # data[20] = 39 [105 overall] -064-065: x 27 # data[21] = 39 [105 overall] -065-066: x 2c # data[22] = 44 [110 overall] +042-043: x 02 # delta encoding: delta8 +043-047: x 00000000 # 32-bit constant: 0 +047-048: x 0c # data[0] = 12 [82 overall] +048-049: x 0c # data[1] = 12 [82 overall] +049-050: x 11 # data[2] = 17 [87 overall] +050-051: x 11 # data[3] = 17 [87 overall] +051-052: x 11 # data[4] = 17 [87 overall] +052-053: x 11 # data[5] = 17 [87 overall] +053-054: x 17 # data[6] = 23 [93 overall] +054-055: x 17 # data[7] = 23 [93 overall] +055-056: x 17 # data[8] = 23 [93 overall] +056-057: x 17 # data[9] = 23 [93 overall] +057-058: x 17 # data[10] = 23 [93 overall] +058-059: x 17 # data[11] = 23 [93 overall] +059-060: x 1e # data[12] = 30 [100 overall] +060-061: x 1e # data[13] = 30 [100 overall] +061-062: x 1e # data[14] = 30 [100 overall] +062-063: x 1e # data[15] = 30 [100 overall] +063-064: x 1e # data[16] = 30 [100 overall] +064-065: x 1e # data[17] = 30 [100 overall] +065-066: x 1e # data[18] = 30 [100 overall] +066-067: x 23 # data[19] = 35 [105 overall] +067-068: x 27 # data[20] = 39 [109 overall] +068-069: x 27 # data[21] = 39 [109 overall] +069-070: x 2c # data[22] = 44 [114 overall] # Data -066-076: x 626c6f636b7072656669 # data[00]: blockprefix_ (block prefix) -076-078: x 785f # (continued...) -078-078: x # data[01]: ............ (bundle prefix) -078-083: x 6170706c65 # data[02]: ............apple -083-083: x # data[03]: ................. -083-083: x # data[04]: ................. -083-083: x # data[05]: ................. -083-089: x 62616e616e61 # data[06]: ............banana -089-089: x # data[07]: .................. -089-089: x # data[08]: .................. -089-089: x # data[09]: .................. -089-089: x # data[10]: .................. -089-089: x # data[11]: .................. -089-096: x 636f636f6e7574 # data[12]: ............coconut -096-096: x # data[13]: ................... -096-096: x # data[14]: ................... -096-096: x # data[15]: ................... -096-096: x # data[16]: ................... -096-096: x # data[17]: ................... -096-096: x # data[18]: ............ (bundle prefix) -096-101: x 6775617661 # data[19]: ............guava -101-105: x 6b697769 # data[20]: ............kiwi -105-105: x # data[21]: ................ -105-110: x 6c656d6f6e # data[22]: ............lemon +070-080: x 626c6f636b7072656669 # data[00]: blockprefix_ (block prefix) +080-082: x 785f # (continued...) +082-082: x # data[01]: ............ (bundle prefix) +082-087: x 6170706c65 # data[02]: ............apple +087-087: x # data[03]: ................. +087-087: x # data[04]: ................. +087-087: x # data[05]: ................. +087-093: x 62616e616e61 # data[06]: ............banana +093-093: x # data[07]: .................. +093-093: x # data[08]: .................. +093-093: x # data[09]: .................. +093-093: x # data[10]: .................. +093-093: x # data[11]: .................. +093-100: x 636f636f6e7574 # data[12]: ............coconut +100-100: x # data[13]: ................... +100-100: x # data[14]: ................... +100-100: x # data[15]: ................... +100-100: x # data[16]: ................... +100-100: x # data[17]: ................... +100-100: x # data[18]: ............ (bundle prefix) +100-105: x 6775617661 # data[19]: ............guava +105-109: x 6b697769 # data[20]: ............kiwi +109-109: x # data[21]: ................ +109-114: x 6c656d6f6e # data[22]: ............lemon # data for column 1 # rawbytes # offsets table -110-111: x 02 # delta encoding: delta8 -111-115: x 00000000 # 32-bit constant: 0 -115-116: x 00 # data[0] = 0 [136 overall] -116-117: x 03 # data[1] = 3 [139 overall] -117-118: x 06 # data[2] = 6 [142 overall] -118-119: x 09 # data[3] = 9 [145 overall] -119-120: x 0c # data[4] = 12 [148 overall] -120-121: x 0f # data[5] = 15 [151 overall] -121-122: x 12 # data[6] = 18 [154 overall] -122-123: x 15 # data[7] = 21 [157 overall] -123-124: x 18 # data[8] = 24 [160 overall] -124-125: x 1a # data[9] = 26 [162 overall] -125-126: x 1c # data[10] = 28 [164 overall] -126-127: x 1c # data[11] = 28 [164 overall] -127-128: x 1f # data[12] = 31 [167 overall] -128-129: x 22 # data[13] = 34 [170 overall] -129-130: x 25 # data[14] = 37 [173 overall] -130-131: x 28 # data[15] = 40 [176 overall] -131-132: x 2a # data[16] = 42 [178 overall] -132-133: x 2d # data[17] = 45 [181 overall] -133-134: x 30 # data[18] = 48 [184 overall] -134-135: x 33 # data[19] = 51 [187 overall] -135-136: x 36 # data[20] = 54 [190 overall] +114-115: x 02 # delta encoding: delta8 +115-119: x 00000000 # 32-bit constant: 0 +119-120: x 00 # data[0] = 0 [140 overall] +120-121: x 03 # data[1] = 3 [143 overall] +121-122: x 06 # data[2] = 6 [146 overall] +122-123: x 09 # data[3] = 9 [149 overall] +123-124: x 0c # data[4] = 12 [152 overall] +124-125: x 0f # data[5] = 15 [155 overall] +125-126: x 12 # data[6] = 18 [158 overall] +126-127: x 15 # data[7] = 21 [161 overall] +127-128: x 18 # data[8] = 24 [164 overall] +128-129: x 1a # data[9] = 26 [166 overall] +129-130: x 1c # data[10] = 28 [168 overall] +130-131: x 1c # data[11] = 28 [168 overall] +131-132: x 1f # data[12] = 31 [171 overall] +132-133: x 22 # data[13] = 34 [174 overall] +133-134: x 25 # data[14] = 37 [177 overall] +134-135: x 28 # data[15] = 40 [180 overall] +135-136: x 2a # data[16] = 42 [182 overall] +136-137: x 2d # data[17] = 45 [185 overall] +137-138: x 30 # data[18] = 48 [188 overall] +138-139: x 33 # data[19] = 51 [191 overall] +139-140: x 36 # data[20] = 54 [194 overall] # data -136-139: x 403938 # data[0]: @98 -139-142: x 403532 # data[1]: @52 -142-145: x 403233 # data[2]: @23 -145-148: x 403131 # data[3]: @11 -148-151: x 403934 # data[4]: @94 -151-154: x 403933 # data[5]: @93 -154-157: x 403933 # data[6]: @93 -157-160: x 403732 # data[7]: @72 -160-162: x 4039 # data[8]: @9 -162-164: x 4031 # data[9]: @1 -164-164: x # data[10]: -164-167: x 403932 # data[11]: @92 -167-170: x 403335 # data[12]: @35 -170-173: x 403232 # data[13]: @22 -173-176: x 403231 # data[14]: @21 -176-178: x 4031 # data[15]: @1 -178-181: x 403939 # data[16]: @99 -181-184: x 403939 # data[17]: @99 -184-187: x 403938 # data[18]: @98 -187-190: x 403932 # data[19]: @92 +140-143: x 403938 # data[0]: @98 +143-146: x 403532 # data[1]: @52 +146-149: x 403233 # data[2]: @23 +149-152: x 403131 # data[3]: @11 +152-155: x 403934 # data[4]: @94 +155-158: x 403933 # data[5]: @93 +158-161: x 403933 # data[6]: @93 +161-164: x 403732 # data[7]: @72 +164-166: x 4039 # data[8]: @9 +166-168: x 4031 # data[9]: @1 +168-168: x # data[10]: +168-171: x 403932 # data[11]: @92 +171-174: x 403335 # data[12]: @35 +174-177: x 403232 # data[13]: @22 +177-180: x 403231 # data[14]: @21 +180-182: x 4031 # data[15]: @1 +182-185: x 403939 # data[16]: @99 +185-188: x 403939 # data[17]: @99 +188-191: x 403938 # data[18]: @98 +191-194: x 403932 # data[19]: @92 # data for column 2 -190-191: x 03 # delta encoding: delta16 -191-199: x 0000000000000000 # 64-bit constant: 0 +194-195: x 03 # delta encoding: delta16 +195-203: x 0000000000000000 # 64-bit constant: 0 # padding -199-200: x 00 # aligning to 16-bit boundary -200-202: x 0100 # data[0] = 1 -202-204: x 0100 # data[1] = 1 -204-206: x 0100 # data[2] = 1 -206-208: x 1200 # data[3] = 18 -208-210: x 12f5 # data[4] = 62738 -210-212: x 00f4 # data[5] = 62464 -212-214: x 12dd # data[6] = 56594 -214-216: x 1200 # data[7] = 18 -216-218: x 0100 # data[8] = 1 -218-220: x 0100 # data[9] = 1 -220-222: x 0100 # data[10] = 1 -222-224: x 0100 # data[11] = 1 -224-226: x 0100 # data[12] = 1 -226-228: x 0100 # data[13] = 1 -228-230: x 0100 # data[14] = 1 -230-232: x 0100 # data[15] = 1 -232-234: x 0100 # data[16] = 1 -234-236: x 0100 # data[17] = 1 -236-238: x 0100 # data[18] = 1 -238-240: x 0000 # data[19] = 0 +203-204: x 00 # aligning to 16-bit boundary +204-206: x 0100 # data[0] = 1 +206-208: x 0100 # data[1] = 1 +208-210: x 0100 # data[2] = 1 +210-212: x 1200 # data[3] = 18 +212-214: x 12f5 # data[4] = 62738 +214-216: x 00f4 # data[5] = 62464 +216-218: x 12dd # data[6] = 56594 +218-220: x 1200 # data[7] = 18 +220-222: x 0100 # data[8] = 1 +222-224: x 0100 # data[9] = 1 +224-226: x 0100 # data[10] = 1 +226-228: x 0100 # data[11] = 1 +228-230: x 0100 # data[12] = 1 +230-232: x 0100 # data[13] = 1 +232-234: x 0100 # data[14] = 1 +234-236: x 0100 # data[15] = 1 +236-238: x 0100 # data[16] = 1 +238-240: x 0100 # data[17] = 1 +240-242: x 0100 # data[18] = 1 +242-244: x 0000 # data[19] = 0 # data for column 3 -240-248: b 0001000100000100000010110000000000000000000000000000000000000000 # bitmap word 0 -248-256: b 0000000100000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 +244-248: x 00000000 # padding to align to 64-bit boundary +248-256: b 0001000100000100000010110000000000000000000000000000000000000000 # bitmap word 0 +256-264: b 0000000100000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 # data for column 4 # rawbytes # offsets table -256-257: x 03 # delta encoding: delta16 -257-261: x 00000000 # 32-bit constant: 0 +264-265: x 03 # delta encoding: delta16 +265-269: x 00000000 # 32-bit constant: 0 # padding -261-262: x 00 # aligning to 16-bit boundary -262-264: x 0000 # data[0] = 0 [304 overall] -264-266: x 0700 # data[1] = 7 [311 overall] -266-268: x 1b00 # data[2] = 27 [331 overall] -268-270: x 2f00 # data[3] = 47 [351 overall] -270-272: x 4300 # data[4] = 67 [371 overall] -272-274: x 4b00 # data[5] = 75 [379 overall] -274-276: x 4b00 # data[6] = 75 [379 overall] -276-278: x 6000 # data[7] = 96 [400 overall] -278-280: x 7500 # data[8] = 117 [421 overall] -280-282: x 8900 # data[9] = 137 [441 overall] -282-284: x 9d00 # data[10] = 157 [461 overall] -284-286: x a400 # data[11] = 164 [468 overall] -286-288: x ba00 # data[12] = 186 [490 overall] -288-290: x d000 # data[13] = 208 [512 overall] -290-292: x e600 # data[14] = 230 [534 overall] -292-294: x fc00 # data[15] = 252 [556 overall] -294-296: x 1101 # data[16] = 273 [577 overall] -296-298: x 2501 # data[17] = 293 [597 overall] -298-300: x 3801 # data[18] = 312 [616 overall] -300-302: x 4b01 # data[19] = 331 [635 overall] -302-304: x 4b01 # data[20] = 331 [635 overall] +269-270: x 00 # aligning to 16-bit boundary +270-272: x 0000 # data[0] = 0 [312 overall] +272-274: x 0700 # data[1] = 7 [319 overall] +274-276: x 1b00 # data[2] = 27 [339 overall] +276-278: x 2f00 # data[3] = 47 [359 overall] +278-280: x 4300 # data[4] = 67 [379 overall] +280-282: x 4b00 # data[5] = 75 [387 overall] +282-284: x 4b00 # data[6] = 75 [387 overall] +284-286: x 6000 # data[7] = 96 [408 overall] +286-288: x 7500 # data[8] = 117 [429 overall] +288-290: x 8900 # data[9] = 137 [449 overall] +290-292: x 9d00 # data[10] = 157 [469 overall] +292-294: x a400 # data[11] = 164 [476 overall] +294-296: x ba00 # data[12] = 186 [498 overall] +296-298: x d000 # data[13] = 208 [520 overall] +298-300: x e600 # data[14] = 230 [542 overall] +300-302: x fc00 # data[15] = 252 [564 overall] +302-304: x 1101 # data[16] = 273 [585 overall] +304-306: x 2501 # data[17] = 293 [605 overall] +306-308: x 3801 # data[18] = 312 [624 overall] +308-310: x 4b01 # data[19] = 331 [643 overall] +310-312: x 4b01 # data[20] = 331 [643 overall] # data -304-311: x 6170706c653938 # data[0]: apple98 -311-321: x a076616c756548616e64 # data[1]: "\xa0valueHandle-apple52" -321-331: x 6c652d6170706c653532 # (continued...) -331-341: x a076616c756548616e64 # data[2]: "\xa0valueHandle-apple23" -341-351: x 6c652d6170706c653233 # (continued...) -351-361: x a076616c756548616e64 # data[3]: "\xa0valueHandle-apple11" -361-371: x 6c652d6170706c653131 # (continued...) -371-379: x 62616e616e613934 # data[4]: banana94 -379-379: x # data[5]: -379-389: x a076616c756548616e64 # data[6]: "\xa0valueHandle-banana93" -389-399: x 6c652d62616e616e6139 # (continued...) -399-400: x 33 # (continued...) -400-410: x a076616c756548616e64 # data[7]: "\xa0valueHandle-banana72" -410-420: x 6c652d62616e616e6137 # (continued...) -420-421: x 32 # (continued...) -421-431: x a076616c756548616e64 # data[8]: "\xa0valueHandle-banana9" -431-441: x 6c652d62616e616e6139 # (continued...) -441-451: x a076616c756548616e64 # data[9]: "\xa0valueHandle-banana1" -451-461: x 6c652d62616e616e6131 # (continued...) -461-468: x 636f636f6e7574 # data[10]: coconut -468-478: x a076616c756548616e64 # data[11]: "\xa0valueHandle-coconut92" -478-488: x 6c652d636f636f6e7574 # (continued...) -488-490: x 3932 # (continued...) -490-500: x a076616c756548616e64 # data[12]: "\xa0valueHandle-coconut35" -500-510: x 6c652d636f636f6e7574 # (continued...) -510-512: x 3335 # (continued...) -512-522: x a076616c756548616e64 # data[13]: "\xa0valueHandle-coconut22" -522-532: x 6c652d636f636f6e7574 # (continued...) -532-534: x 3232 # (continued...) -534-544: x a076616c756548616e64 # data[14]: "\xa0valueHandle-coconut21" -544-554: x 6c652d636f636f6e7574 # (continued...) -554-556: x 3231 # (continued...) -556-566: x a076616c756548616e64 # data[15]: "\xa0valueHandle-coconut1" -566-576: x 6c652d636f636f6e7574 # (continued...) -576-577: x 31 # (continued...) -577-587: x 8076616c756548616e64 # data[16]: "\x80valueHandle-guava99" -587-597: x 6c652d67756176613939 # (continued...) -597-607: x 8076616c756548616e64 # data[17]: "\x80valueHandle-kiwi99" -607-616: x 6c652d6b6977693939 # (continued...) -616-626: x a076616c756548616e64 # data[18]: "\xa0valueHandle-kiwi98" -626-635: x 6c652d6b6977693938 # (continued...) -635-635: x # data[19]: +312-319: x 6170706c653938 # data[0]: apple98 +319-329: x a076616c756548616e64 # data[1]: "\xa0valueHandle-apple52" +329-339: x 6c652d6170706c653532 # (continued...) +339-349: x a076616c756548616e64 # data[2]: "\xa0valueHandle-apple23" +349-359: x 6c652d6170706c653233 # (continued...) +359-369: x a076616c756548616e64 # data[3]: "\xa0valueHandle-apple11" +369-379: x 6c652d6170706c653131 # (continued...) +379-387: x 62616e616e613934 # data[4]: banana94 +387-387: x # data[5]: +387-397: x a076616c756548616e64 # data[6]: "\xa0valueHandle-banana93" +397-407: x 6c652d62616e616e6139 # (continued...) +407-408: x 33 # (continued...) +408-418: x a076616c756548616e64 # data[7]: "\xa0valueHandle-banana72" +418-428: x 6c652d62616e616e6137 # (continued...) +428-429: x 32 # (continued...) +429-439: x a076616c756548616e64 # data[8]: "\xa0valueHandle-banana9" +439-449: x 6c652d62616e616e6139 # (continued...) +449-459: x a076616c756548616e64 # data[9]: "\xa0valueHandle-banana1" +459-469: x 6c652d62616e616e6131 # (continued...) +469-476: x 636f636f6e7574 # data[10]: coconut +476-486: x a076616c756548616e64 # data[11]: "\xa0valueHandle-coconut92" +486-496: x 6c652d636f636f6e7574 # (continued...) +496-498: x 3932 # (continued...) +498-508: x a076616c756548616e64 # data[12]: "\xa0valueHandle-coconut35" +508-518: x 6c652d636f636f6e7574 # (continued...) +518-520: x 3335 # (continued...) +520-530: x a076616c756548616e64 # data[13]: "\xa0valueHandle-coconut22" +530-540: x 6c652d636f636f6e7574 # (continued...) +540-542: x 3232 # (continued...) +542-552: x a076616c756548616e64 # data[14]: "\xa0valueHandle-coconut21" +552-562: x 6c652d636f636f6e7574 # (continued...) +562-564: x 3231 # (continued...) +564-574: x a076616c756548616e64 # data[15]: "\xa0valueHandle-coconut1" +574-584: x 6c652d636f636f6e7574 # (continued...) +584-585: x 31 # (continued...) +585-595: x 8076616c756548616e64 # data[16]: "\x80valueHandle-guava99" +595-605: x 6c652d67756176613939 # (continued...) +605-615: x 8076616c756548616e64 # data[17]: "\x80valueHandle-kiwi99" +615-624: x 6c652d6b6977693939 # (continued...) +624-634: x a076616c756548616e64 # data[18]: "\xa0valueHandle-kiwi98" +634-643: x 6c652d6b6977693938 # (continued...) +643-643: x # data[19]: # data for column 5 -635-640: x 0000000000 # padding to align to 64-bit boundary -640-648: b 1100111011111011000001110000000000000000000000000000000000000000 # bitmap word 0 -648-656: b 0000000100000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 +643-648: x 0000000000 # padding to align to 64-bit boundary +648-656: b 1100111011111011000001110000000000000000000000000000000000000000 # bitmap word 0 +656-664: b 0000000100000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 # Scan across the block using next. iter diff --git a/sstable/colblk/testdata/data_block/next_prefix b/sstable/colblk/testdata/data_block/next_prefix index b0bd2e2f64..006ebf910b 100644 --- a/sstable/colblk/testdata/data_block/next_prefix +++ b/sstable/colblk/testdata/data_block/next_prefix @@ -30,7 +30,7 @@ blockprefix_kiwi@99#0,SET:kiwi99 blockprefix_kiwi@98#0,SET:kiwi98 blockprefix_lemon@92#0,DEL: ---- -size=441: +size=449: 0: prefixes: prefixbytes(16): 20 keys 1: suffixes: bytes: 20 rows set; 54 bytes in data 2: trailers: uint64: 20 rows @@ -40,208 +40,211 @@ size=441: finish ---- +# data block header +000-004: x 16000000 # maximum key length: 22 # columnar block header -000-001: x 01 # version 1 -001-003: x 0600 # 6 columns -003-007: x 14000000 # 20 rows +004-005: x 01 # version 1 +005-007: x 0600 # 6 columns +007-011: x 14000000 # 20 rows # column 0 -007-008: b 00000111 # prefixbytes -008-012: x 25000000 # page start 37 +011-012: b 00000111 # prefixbytes +012-016: x 29000000 # page start 41 # column 1 -012-013: b 00000110 # bytes -013-017: x 6e000000 # page start 110 +016-017: b 00000110 # bytes +017-021: x 72000000 # page start 114 # column 2 -017-018: b 00000101 # uint64 -018-022: x be000000 # page start 190 +021-022: b 00000101 # uint64 +022-026: x c2000000 # page start 194 # column 3 -022-023: b 00000001 # bool -023-027: x f0000000 # page start 240 +026-027: b 00000001 # bool +027-031: x f4000000 # page start 244 # column 4 -027-028: b 00000110 # bytes -028-032: x 00010000 # page start 256 +031-032: b 00000110 # bytes +032-036: x 08010000 # page start 264 # column 5 -032-033: b 00000001 # bool -033-037: x a2010000 # page start 418 +036-037: b 00000001 # bool +037-041: x aa010000 # page start 426 # data for column 0 # PrefixBytes -037-038: x 04 # bundleSize: 16 +041-042: x 04 # bundleSize: 16 # Offsets table -038-039: x 02 # delta encoding: delta8 -039-043: x 00000000 # 32-bit constant: 0 -043-044: x 0c # data[0] = 12 [78 overall] -044-045: x 0c # data[1] = 12 [78 overall] -045-046: x 11 # data[2] = 17 [83 overall] -046-047: x 11 # data[3] = 17 [83 overall] -047-048: x 11 # data[4] = 17 [83 overall] -048-049: x 11 # data[5] = 17 [83 overall] -049-050: x 17 # data[6] = 23 [89 overall] -050-051: x 17 # data[7] = 23 [89 overall] -051-052: x 17 # data[8] = 23 [89 overall] -052-053: x 17 # data[9] = 23 [89 overall] -053-054: x 17 # data[10] = 23 [89 overall] -054-055: x 17 # data[11] = 23 [89 overall] -055-056: x 1e # data[12] = 30 [96 overall] -056-057: x 1e # data[13] = 30 [96 overall] -057-058: x 1e # data[14] = 30 [96 overall] -058-059: x 1e # data[15] = 30 [96 overall] -059-060: x 1e # data[16] = 30 [96 overall] -060-061: x 1e # data[17] = 30 [96 overall] -061-062: x 1e # data[18] = 30 [96 overall] -062-063: x 23 # data[19] = 35 [101 overall] -063-064: x 27 # data[20] = 39 [105 overall] -064-065: x 27 # data[21] = 39 [105 overall] -065-066: x 2c # data[22] = 44 [110 overall] +042-043: x 02 # delta encoding: delta8 +043-047: x 00000000 # 32-bit constant: 0 +047-048: x 0c # data[0] = 12 [82 overall] +048-049: x 0c # data[1] = 12 [82 overall] +049-050: x 11 # data[2] = 17 [87 overall] +050-051: x 11 # data[3] = 17 [87 overall] +051-052: x 11 # data[4] = 17 [87 overall] +052-053: x 11 # data[5] = 17 [87 overall] +053-054: x 17 # data[6] = 23 [93 overall] +054-055: x 17 # data[7] = 23 [93 overall] +055-056: x 17 # data[8] = 23 [93 overall] +056-057: x 17 # data[9] = 23 [93 overall] +057-058: x 17 # data[10] = 23 [93 overall] +058-059: x 17 # data[11] = 23 [93 overall] +059-060: x 1e # data[12] = 30 [100 overall] +060-061: x 1e # data[13] = 30 [100 overall] +061-062: x 1e # data[14] = 30 [100 overall] +062-063: x 1e # data[15] = 30 [100 overall] +063-064: x 1e # data[16] = 30 [100 overall] +064-065: x 1e # data[17] = 30 [100 overall] +065-066: x 1e # data[18] = 30 [100 overall] +066-067: x 23 # data[19] = 35 [105 overall] +067-068: x 27 # data[20] = 39 [109 overall] +068-069: x 27 # data[21] = 39 [109 overall] +069-070: x 2c # data[22] = 44 [114 overall] # Data -066-076: x 626c6f636b7072656669 # data[00]: blockprefix_ (block prefix) -076-078: x 785f # (continued...) -078-078: x # data[01]: ............ (bundle prefix) -078-083: x 6170706c65 # data[02]: ............apple -083-083: x # data[03]: ................. -083-083: x # data[04]: ................. -083-083: x # data[05]: ................. -083-089: x 62616e616e61 # data[06]: ............banana -089-089: x # data[07]: .................. -089-089: x # data[08]: .................. -089-089: x # data[09]: .................. -089-089: x # data[10]: .................. -089-089: x # data[11]: .................. -089-096: x 636f636f6e7574 # data[12]: ............coconut -096-096: x # data[13]: ................... -096-096: x # data[14]: ................... -096-096: x # data[15]: ................... -096-096: x # data[16]: ................... -096-096: x # data[17]: ................... -096-096: x # data[18]: ............ (bundle prefix) -096-101: x 6775617661 # data[19]: ............guava -101-105: x 6b697769 # data[20]: ............kiwi -105-105: x # data[21]: ................ -105-110: x 6c656d6f6e # data[22]: ............lemon +070-080: x 626c6f636b7072656669 # data[00]: blockprefix_ (block prefix) +080-082: x 785f # (continued...) +082-082: x # data[01]: ............ (bundle prefix) +082-087: x 6170706c65 # data[02]: ............apple +087-087: x # data[03]: ................. +087-087: x # data[04]: ................. +087-087: x # data[05]: ................. +087-093: x 62616e616e61 # data[06]: ............banana +093-093: x # data[07]: .................. +093-093: x # data[08]: .................. +093-093: x # data[09]: .................. +093-093: x # data[10]: .................. +093-093: x # data[11]: .................. +093-100: x 636f636f6e7574 # data[12]: ............coconut +100-100: x # data[13]: ................... +100-100: x # data[14]: ................... +100-100: x # data[15]: ................... +100-100: x # data[16]: ................... +100-100: x # data[17]: ................... +100-100: x # data[18]: ............ (bundle prefix) +100-105: x 6775617661 # data[19]: ............guava +105-109: x 6b697769 # data[20]: ............kiwi +109-109: x # data[21]: ................ +109-114: x 6c656d6f6e # data[22]: ............lemon # data for column 1 # rawbytes # offsets table -110-111: x 02 # delta encoding: delta8 -111-115: x 00000000 # 32-bit constant: 0 -115-116: x 00 # data[0] = 0 [136 overall] -116-117: x 03 # data[1] = 3 [139 overall] -117-118: x 06 # data[2] = 6 [142 overall] -118-119: x 09 # data[3] = 9 [145 overall] -119-120: x 0c # data[4] = 12 [148 overall] -120-121: x 0f # data[5] = 15 [151 overall] -121-122: x 12 # data[6] = 18 [154 overall] -122-123: x 15 # data[7] = 21 [157 overall] -123-124: x 18 # data[8] = 24 [160 overall] -124-125: x 1a # data[9] = 26 [162 overall] -125-126: x 1c # data[10] = 28 [164 overall] -126-127: x 1c # data[11] = 28 [164 overall] -127-128: x 1f # data[12] = 31 [167 overall] -128-129: x 22 # data[13] = 34 [170 overall] -129-130: x 25 # data[14] = 37 [173 overall] -130-131: x 28 # data[15] = 40 [176 overall] -131-132: x 2a # data[16] = 42 [178 overall] -132-133: x 2d # data[17] = 45 [181 overall] -133-134: x 30 # data[18] = 48 [184 overall] -134-135: x 33 # data[19] = 51 [187 overall] -135-136: x 36 # data[20] = 54 [190 overall] +114-115: x 02 # delta encoding: delta8 +115-119: x 00000000 # 32-bit constant: 0 +119-120: x 00 # data[0] = 0 [140 overall] +120-121: x 03 # data[1] = 3 [143 overall] +121-122: x 06 # data[2] = 6 [146 overall] +122-123: x 09 # data[3] = 9 [149 overall] +123-124: x 0c # data[4] = 12 [152 overall] +124-125: x 0f # data[5] = 15 [155 overall] +125-126: x 12 # data[6] = 18 [158 overall] +126-127: x 15 # data[7] = 21 [161 overall] +127-128: x 18 # data[8] = 24 [164 overall] +128-129: x 1a # data[9] = 26 [166 overall] +129-130: x 1c # data[10] = 28 [168 overall] +130-131: x 1c # data[11] = 28 [168 overall] +131-132: x 1f # data[12] = 31 [171 overall] +132-133: x 22 # data[13] = 34 [174 overall] +133-134: x 25 # data[14] = 37 [177 overall] +134-135: x 28 # data[15] = 40 [180 overall] +135-136: x 2a # data[16] = 42 [182 overall] +136-137: x 2d # data[17] = 45 [185 overall] +137-138: x 30 # data[18] = 48 [188 overall] +138-139: x 33 # data[19] = 51 [191 overall] +139-140: x 36 # data[20] = 54 [194 overall] # data -136-139: x 403938 # data[0]: @98 -139-142: x 403532 # data[1]: @52 -142-145: x 403233 # data[2]: @23 -145-148: x 403131 # data[3]: @11 -148-151: x 403934 # data[4]: @94 -151-154: x 403933 # data[5]: @93 -154-157: x 403933 # data[6]: @93 -157-160: x 403732 # data[7]: @72 -160-162: x 4039 # data[8]: @9 -162-164: x 4031 # data[9]: @1 -164-164: x # data[10]: -164-167: x 403932 # data[11]: @92 -167-170: x 403335 # data[12]: @35 -170-173: x 403232 # data[13]: @22 -173-176: x 403231 # data[14]: @21 -176-178: x 4031 # data[15]: @1 -178-181: x 403939 # data[16]: @99 -181-184: x 403939 # data[17]: @99 -184-187: x 403938 # data[18]: @98 -187-190: x 403932 # data[19]: @92 +140-143: x 403938 # data[0]: @98 +143-146: x 403532 # data[1]: @52 +146-149: x 403233 # data[2]: @23 +149-152: x 403131 # data[3]: @11 +152-155: x 403934 # data[4]: @94 +155-158: x 403933 # data[5]: @93 +158-161: x 403933 # data[6]: @93 +161-164: x 403732 # data[7]: @72 +164-166: x 4039 # data[8]: @9 +166-168: x 4031 # data[9]: @1 +168-168: x # data[10]: +168-171: x 403932 # data[11]: @92 +171-174: x 403335 # data[12]: @35 +174-177: x 403232 # data[13]: @22 +177-180: x 403231 # data[14]: @21 +180-182: x 4031 # data[15]: @1 +182-185: x 403939 # data[16]: @99 +185-188: x 403939 # data[17]: @99 +188-191: x 403938 # data[18]: @98 +191-194: x 403932 # data[19]: @92 # data for column 2 -190-191: x 03 # delta encoding: delta16 -191-199: x 0000000000000000 # 64-bit constant: 0 +194-195: x 03 # delta encoding: delta16 +195-203: x 0000000000000000 # 64-bit constant: 0 # padding -199-200: x 00 # aligning to 16-bit boundary -200-202: x 0100 # data[0] = 1 -202-204: x 0100 # data[1] = 1 -204-206: x 0100 # data[2] = 1 -206-208: x 1200 # data[3] = 18 -208-210: x 12f5 # data[4] = 62738 -210-212: x 00f4 # data[5] = 62464 -212-214: x 12dd # data[6] = 56594 -214-216: x 1200 # data[7] = 18 -216-218: x 0100 # data[8] = 1 -218-220: x 0100 # data[9] = 1 -220-222: x 0100 # data[10] = 1 -222-224: x 0100 # data[11] = 1 -224-226: x 0100 # data[12] = 1 -226-228: x 0100 # data[13] = 1 -228-230: x 0100 # data[14] = 1 -230-232: x 0100 # data[15] = 1 -232-234: x 0100 # data[16] = 1 -234-236: x 0100 # data[17] = 1 -236-238: x 0100 # data[18] = 1 -238-240: x 0000 # data[19] = 0 +203-204: x 00 # aligning to 16-bit boundary +204-206: x 0100 # data[0] = 1 +206-208: x 0100 # data[1] = 1 +208-210: x 0100 # data[2] = 1 +210-212: x 1200 # data[3] = 18 +212-214: x 12f5 # data[4] = 62738 +214-216: x 00f4 # data[5] = 62464 +216-218: x 12dd # data[6] = 56594 +218-220: x 1200 # data[7] = 18 +220-222: x 0100 # data[8] = 1 +222-224: x 0100 # data[9] = 1 +224-226: x 0100 # data[10] = 1 +226-228: x 0100 # data[11] = 1 +228-230: x 0100 # data[12] = 1 +230-232: x 0100 # data[13] = 1 +232-234: x 0100 # data[14] = 1 +234-236: x 0100 # data[15] = 1 +236-238: x 0100 # data[16] = 1 +238-240: x 0100 # data[17] = 1 +240-242: x 0100 # data[18] = 1 +242-244: x 0000 # data[19] = 0 # data for column 3 -240-248: b 0001000100000100000010110000000000000000000000000000000000000000 # bitmap word 0 -248-256: b 0000000100000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 +244-248: x 00000000 # padding to align to 64-bit boundary +248-256: b 0001000100000100000010110000000000000000000000000000000000000000 # bitmap word 0 +256-264: b 0000000100000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 # data for column 4 # rawbytes # offsets table -256-257: x 02 # delta encoding: delta8 -257-261: x 00000000 # 32-bit constant: 0 -261-262: x 00 # data[0] = 0 [282 overall] -262-263: x 07 # data[1] = 7 [289 overall] -263-264: x 0e # data[2] = 14 [296 overall] -264-265: x 15 # data[3] = 21 [303 overall] -265-266: x 1c # data[4] = 28 [310 overall] -266-267: x 24 # data[5] = 36 [318 overall] -267-268: x 24 # data[6] = 36 [318 overall] -268-269: x 2c # data[7] = 44 [326 overall] -269-270: x 34 # data[8] = 52 [334 overall] -270-271: x 3b # data[9] = 59 [341 overall] -271-272: x 42 # data[10] = 66 [348 overall] -272-273: x 49 # data[11] = 73 [355 overall] -273-274: x 52 # data[12] = 82 [364 overall] -274-275: x 5b # data[13] = 91 [373 overall] -275-276: x 64 # data[14] = 100 [382 overall] -276-277: x 6d # data[15] = 109 [391 overall] -277-278: x 75 # data[16] = 117 [399 overall] -278-279: x 7c # data[17] = 124 [406 overall] -279-280: x 82 # data[18] = 130 [412 overall] -280-281: x 88 # data[19] = 136 [418 overall] -281-282: x 88 # data[20] = 136 [418 overall] +264-265: x 02 # delta encoding: delta8 +265-269: x 00000000 # 32-bit constant: 0 +269-270: x 00 # data[0] = 0 [290 overall] +270-271: x 07 # data[1] = 7 [297 overall] +271-272: x 0e # data[2] = 14 [304 overall] +272-273: x 15 # data[3] = 21 [311 overall] +273-274: x 1c # data[4] = 28 [318 overall] +274-275: x 24 # data[5] = 36 [326 overall] +275-276: x 24 # data[6] = 36 [326 overall] +276-277: x 2c # data[7] = 44 [334 overall] +277-278: x 34 # data[8] = 52 [342 overall] +278-279: x 3b # data[9] = 59 [349 overall] +279-280: x 42 # data[10] = 66 [356 overall] +280-281: x 49 # data[11] = 73 [363 overall] +281-282: x 52 # data[12] = 82 [372 overall] +282-283: x 5b # data[13] = 91 [381 overall] +283-284: x 64 # data[14] = 100 [390 overall] +284-285: x 6d # data[15] = 109 [399 overall] +285-286: x 75 # data[16] = 117 [407 overall] +286-287: x 7c # data[17] = 124 [414 overall] +287-288: x 82 # data[18] = 130 [420 overall] +288-289: x 88 # data[19] = 136 [426 overall] +289-290: x 88 # data[20] = 136 [426 overall] # data -282-289: x 6170706c653938 # data[0]: apple98 -289-296: x 6170706c653532 # data[1]: apple52 -296-303: x 6170706c653233 # data[2]: apple23 -303-310: x 6170706c653131 # data[3]: apple11 -310-318: x 62616e616e613934 # data[4]: banana94 -318-318: x # data[5]: -318-326: x 62616e616e613933 # data[6]: banana93 -326-334: x 62616e616e613732 # data[7]: banana72 -334-341: x 62616e616e6139 # data[8]: banana9 -341-348: x 62616e616e6131 # data[9]: banana1 -348-355: x 636f636f6e7574 # data[10]: coconut -355-364: x 636f636f6e75743932 # data[11]: coconut92 -364-373: x 636f636f6e75743335 # data[12]: coconut35 -373-382: x 636f636f6e75743232 # data[13]: coconut22 -382-391: x 636f636f6e75743231 # data[14]: coconut21 -391-399: x 636f636f6e757431 # data[15]: coconut1 -399-406: x 67756176613939 # data[16]: guava99 -406-412: x 6b6977693939 # data[17]: kiwi99 -412-418: x 6b6977693938 # data[18]: kiwi98 -418-418: x # data[19]: +290-297: x 6170706c653938 # data[0]: apple98 +297-304: x 6170706c653532 # data[1]: apple52 +304-311: x 6170706c653233 # data[2]: apple23 +311-318: x 6170706c653131 # data[3]: apple11 +318-326: x 62616e616e613934 # data[4]: banana94 +326-326: x # data[5]: +326-334: x 62616e616e613933 # data[6]: banana93 +334-342: x 62616e616e613732 # data[7]: banana72 +342-349: x 62616e616e6139 # data[8]: banana9 +349-356: x 62616e616e6131 # data[9]: banana1 +356-363: x 636f636f6e7574 # data[10]: coconut +363-372: x 636f636f6e75743932 # data[11]: coconut92 +372-381: x 636f636f6e75743335 # data[12]: coconut35 +381-390: x 636f636f6e75743232 # data[13]: coconut22 +390-399: x 636f636f6e75743231 # data[14]: coconut21 +399-407: x 636f636f6e757431 # data[15]: coconut1 +407-414: x 67756176613939 # data[16]: guava99 +414-420: x 6b6977693939 # data[17]: kiwi99 +420-426: x 6b6977693938 # data[18]: kiwi98 +426-426: x # data[19]: # data for column 5 -418-424: x 000000000000 # padding to align to 64-bit boundary -424-432: b 0000000000000000000000000000000000000000000000000000000000000000 # bitmap word 0 -432-440: b 0000000000000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 +426-432: x 000000000000 # padding to align to 64-bit boundary +432-440: b 0000000000000000000000000000000000000000000000000000000000000000 # bitmap word 0 +440-448: b 0000000000000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 # Scan across the block using next prefix. diff --git a/sstable/colblk/testdata/data_block/simple b/sstable/colblk/testdata/data_block/simple index 2b7e3389c9..52e8d71f9c 100644 --- a/sstable/colblk/testdata/data_block/simple +++ b/sstable/colblk/testdata/data_block/simple @@ -16,7 +16,7 @@ c@9#0,SETWITHDEL:coconut c@6#0,SET:cantelope c@1#0,SET:clementine ---- -size=193: +size=201: 0: prefixes: prefixbytes(16): 6 keys 1: suffixes: bytes: 6 rows set; 13 bytes in data 2: trailers: uint64: 6 rows @@ -27,7 +27,7 @@ size=193: write d@11#0,DEL: ---- -size=201: +size=209: 0: prefixes: prefixbytes(16): 7 keys 1: suffixes: bytes: 7 rows set; 16 bytes in data 2: trailers: uint64: 7 rows @@ -37,113 +37,115 @@ size=201: finish ---- +# data block header +000-004: x 04000000 # maximum key length: 4 # columnar block header -000-001: x 01 # version 1 -001-003: x 0600 # 6 columns -003-007: x 07000000 # 7 rows +004-005: x 01 # version 1 +005-007: x 0600 # 6 columns +007-011: x 07000000 # 7 rows # column 0 -007-008: b 00000111 # prefixbytes -008-012: x 25000000 # page start 37 +011-012: b 00000111 # prefixbytes +012-016: x 29000000 # page start 41 # column 1 -012-013: b 00000110 # bytes -013-017: x 38000000 # page start 56 +016-017: b 00000110 # bytes +017-021: x 3c000000 # page start 60 # column 2 -017-018: b 00000101 # uint64 -018-022: x 55000000 # page start 85 +021-022: b 00000101 # uint64 +022-026: x 59000000 # page start 89 # column 3 -022-023: b 00000001 # bool -023-027: x 65000000 # page start 101 +026-027: b 00000001 # bool +027-031: x 69000000 # page start 105 # column 4 -027-028: b 00000110 # bytes -028-032: x 78000000 # page start 120 +031-032: b 00000110 # bytes +032-036: x 80000000 # page start 128 # column 5 -032-033: b 00000001 # bool -033-037: x b3000000 # page start 179 +036-037: b 00000001 # bool +037-041: x bb000000 # page start 187 # data for column 0 # PrefixBytes -037-038: x 04 # bundleSize: 16 +041-042: x 04 # bundleSize: 16 # Offsets table -038-039: x 02 # delta encoding: delta8 -039-043: x 00000000 # 32-bit constant: 0 -043-044: x 00 # data[0] = 0 [52 overall] -044-045: x 00 # data[1] = 0 [52 overall] -045-046: x 01 # data[2] = 1 [53 overall] -046-047: x 02 # data[3] = 2 [54 overall] -047-048: x 02 # data[4] = 2 [54 overall] -048-049: x 03 # data[5] = 3 [55 overall] -049-050: x 03 # data[6] = 3 [55 overall] -050-051: x 03 # data[7] = 3 [55 overall] -051-052: x 04 # data[8] = 4 [56 overall] +042-043: x 02 # delta encoding: delta8 +043-047: x 00000000 # 32-bit constant: 0 +047-048: x 00 # data[0] = 0 [56 overall] +048-049: x 00 # data[1] = 0 [56 overall] +049-050: x 01 # data[2] = 1 [57 overall] +050-051: x 02 # data[3] = 2 [58 overall] +051-052: x 02 # data[4] = 2 [58 overall] +052-053: x 03 # data[5] = 3 [59 overall] +053-054: x 03 # data[6] = 3 [59 overall] +054-055: x 03 # data[7] = 3 [59 overall] +055-056: x 04 # data[8] = 4 [60 overall] # Data -052-052: x # data[00]: (block prefix) -052-052: x # data[01]: (bundle prefix) -052-053: x 61 # data[02]: a -053-054: x 62 # data[03]: b -054-054: x # data[04]: . -054-055: x 63 # data[05]: c -055-055: x # data[06]: . -055-055: x # data[07]: . -055-056: x 64 # data[08]: d +056-056: x # data[00]: (block prefix) +056-056: x # data[01]: (bundle prefix) +056-057: x 61 # data[02]: a +057-058: x 62 # data[03]: b +058-058: x # data[04]: . +058-059: x 63 # data[05]: c +059-059: x # data[06]: . +059-059: x # data[07]: . +059-060: x 64 # data[08]: d # data for column 1 # rawbytes # offsets table -056-057: x 02 # delta encoding: delta8 -057-061: x 00000000 # 32-bit constant: 0 -061-062: x 00 # data[0] = 0 [69 overall] -062-063: x 03 # data[1] = 3 [72 overall] -063-064: x 05 # data[2] = 5 [74 overall] -064-065: x 07 # data[3] = 7 [76 overall] -065-066: x 09 # data[4] = 9 [78 overall] -066-067: x 0b # data[5] = 11 [80 overall] -067-068: x 0d # data[6] = 13 [82 overall] -068-069: x 10 # data[7] = 16 [85 overall] +060-061: x 02 # delta encoding: delta8 +061-065: x 00000000 # 32-bit constant: 0 +065-066: x 00 # data[0] = 0 [73 overall] +066-067: x 03 # data[1] = 3 [76 overall] +067-068: x 05 # data[2] = 5 [78 overall] +068-069: x 07 # data[3] = 7 [80 overall] +069-070: x 09 # data[4] = 9 [82 overall] +070-071: x 0b # data[5] = 11 [84 overall] +071-072: x 0d # data[6] = 13 [86 overall] +072-073: x 10 # data[7] = 16 [89 overall] # data -069-072: x 403130 # data[0]: @10 -072-074: x 4035 # data[1]: @5 -074-076: x 4032 # data[2]: @2 -076-078: x 4039 # data[3]: @9 -078-080: x 4036 # data[4]: @6 -080-082: x 4031 # data[5]: @1 -082-085: x 403131 # data[6]: @11 +073-076: x 403130 # data[0]: @10 +076-078: x 4035 # data[1]: @5 +078-080: x 4032 # data[2]: @2 +080-082: x 4039 # data[3]: @9 +082-084: x 4036 # data[4]: @6 +084-086: x 4031 # data[5]: @1 +086-089: x 403131 # data[6]: @11 # data for column 2 -085-086: x 02 # delta encoding: delta8 -086-094: x 0000000000000000 # 64-bit constant: 0 -094-095: x 01 # data[0] = 1 -095-096: x 01 # data[1] = 1 -096-097: x 12 # data[2] = 18 -097-098: x 12 # data[3] = 18 -098-099: x 01 # data[4] = 1 -099-100: x 01 # data[5] = 1 -100-101: x 00 # data[6] = 0 +089-090: x 02 # delta encoding: delta8 +090-098: x 0000000000000000 # 64-bit constant: 0 +098-099: x 01 # data[0] = 1 +099-100: x 01 # data[1] = 1 +100-101: x 12 # data[2] = 18 +101-102: x 12 # data[3] = 18 +102-103: x 01 # data[4] = 1 +103-104: x 01 # data[5] = 1 +104-105: x 00 # data[6] = 0 # data for column 3 -101-104: x 000000 # padding to align to 64-bit boundary -104-112: b 0100101100000000000000000000000000000000000000000000000000000000 # bitmap word 0 -112-120: b 0000000100000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 +105-112: x 00000000000000 # padding to align to 64-bit boundary +112-120: b 0100101100000000000000000000000000000000000000000000000000000000 # bitmap word 0 +120-128: b 0000000100000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 # data for column 4 # rawbytes # offsets table -120-121: x 02 # delta encoding: delta8 -121-125: x 00000000 # 32-bit constant: 0 -125-126: x 00 # data[0] = 0 [133 overall] -126-127: x 05 # data[1] = 5 [138 overall] -127-128: x 0b # data[2] = 11 [144 overall] -128-129: x 14 # data[3] = 20 [153 overall] -129-130: x 1b # data[4] = 27 [160 overall] -130-131: x 24 # data[5] = 36 [169 overall] -131-132: x 2e # data[6] = 46 [179 overall] -132-133: x 2e # data[7] = 46 [179 overall] +128-129: x 02 # delta encoding: delta8 +129-133: x 00000000 # 32-bit constant: 0 +133-134: x 00 # data[0] = 0 [141 overall] +134-135: x 05 # data[1] = 5 [146 overall] +135-136: x 0b # data[2] = 11 [152 overall] +136-137: x 14 # data[3] = 20 [161 overall] +137-138: x 1b # data[4] = 27 [168 overall] +138-139: x 24 # data[5] = 36 [177 overall] +139-140: x 2e # data[6] = 46 [187 overall] +140-141: x 2e # data[7] = 46 [187 overall] # data -133-138: x 6170706c65 # data[0]: apple -138-144: x 62616e616e61 # data[1]: banana -144-153: x 626c75656265727279 # data[2]: blueberry -153-160: x 636f636f6e7574 # data[3]: coconut -160-169: x 63616e74656c6f7065 # data[4]: cantelope -169-179: x 636c656d656e74696e65 # data[5]: clementine -179-179: x # data[6]: +141-146: x 6170706c65 # data[0]: apple +146-152: x 62616e616e61 # data[1]: banana +152-161: x 626c75656265727279 # data[2]: blueberry +161-168: x 636f636f6e7574 # data[3]: coconut +168-177: x 63616e74656c6f7065 # data[4]: cantelope +177-187: x 636c656d656e74696e65 # data[5]: clementine +187-187: x # data[6]: # data for column 5 -179-184: x 0000000000 # padding to align to 64-bit boundary -184-192: b 0000000000000000000000000000000000000000000000000000000000000000 # bitmap word 0 -192-200: b 0000000000000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 +187-192: x 0000000000 # padding to align to 64-bit boundary +192-200: b 0000000000000000000000000000000000000000000000000000000000000000 # bitmap word 0 +200-208: b 0000000000000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 iter first @@ -328,7 +330,7 @@ aaaaaaaaaaaaaaapproves@10#0,SET:a aaaaaaaaaaaaaaarresting@10#0,SET:a aaaaaaaaaaaaaaarrived@10#0,SET:a ---- -size=353: +size=361: 0: prefixes: prefixbytes(16): 17 keys 1: suffixes: bytes: 17 rows set; 51 bytes in data 2: trailers: uint64: 17 rows @@ -338,168 +340,170 @@ size=353: finish ---- +# data block header +000-004: x 1c000000 # maximum key length: 28 # columnar block header -000-001: x 01 # version 1 -001-003: x 0600 # 6 columns -003-007: x 11000000 # 17 rows +004-005: x 01 # version 1 +005-007: x 0600 # 6 columns +007-011: x 11000000 # 17 rows # column 0 -007-008: b 00000111 # prefixbytes -008-012: x 25000000 # page start 37 +011-012: b 00000111 # prefixbytes +012-016: x 29000000 # page start 41 # column 1 -012-013: b 00000110 # bytes -013-017: x c3000000 # page start 195 +016-017: b 00000110 # bytes +017-021: x c7000000 # page start 199 # column 2 -017-018: b 00000101 # uint64 -018-022: x 0d010000 # page start 269 +021-022: b 00000101 # uint64 +022-026: x 11010000 # page start 273 # column 3 -022-023: b 00000001 # bool -023-027: x 16010000 # page start 278 +026-027: b 00000001 # bool +027-031: x 1a010000 # page start 282 # column 4 -027-028: b 00000110 # bytes -028-032: x 28010000 # page start 296 +031-032: b 00000110 # bytes +032-036: x 30010000 # page start 304 # column 5 -032-033: b 00000001 # bool -033-037: x 50010000 # page start 336 +036-037: b 00000001 # bool +037-041: x 58010000 # page start 344 # data for column 0 # PrefixBytes -037-038: x 04 # bundleSize: 16 +041-042: x 04 # bundleSize: 16 # Offsets table -038-039: x 02 # delta encoding: delta8 -039-043: x 00000000 # 32-bit constant: 0 -043-044: x 0f # data[0] = 15 [78 overall] -044-045: x 0f # data[1] = 15 [78 overall] -045-046: x 17 # data[2] = 23 [86 overall] -046-047: x 1d # data[3] = 29 [92 overall] -047-048: x 26 # data[4] = 38 [101 overall] -048-049: x 2e # data[5] = 46 [109 overall] -049-050: x 33 # data[6] = 51 [114 overall] -050-051: x 3b # data[7] = 59 [122 overall] -051-052: x 42 # data[8] = 66 [129 overall] -052-053: x 48 # data[9] = 72 [135 overall] -053-054: x 4c # data[10] = 76 [139 overall] -054-055: x 56 # data[11] = 86 [149 overall] -055-056: x 5c # data[12] = 92 [155 overall] -056-057: x 63 # data[13] = 99 [162 overall] -057-058: x 69 # data[14] = 105 [168 overall] -058-059: x 6f # data[15] = 111 [174 overall] -059-060: x 76 # data[16] = 118 [181 overall] -060-061: x 7e # data[17] = 126 [189 overall] -061-062: x 84 # data[18] = 132 [195 overall] -062-063: x 84 # data[19] = 132 [195 overall] +042-043: x 02 # delta encoding: delta8 +043-047: x 00000000 # 32-bit constant: 0 +047-048: x 0f # data[0] = 15 [82 overall] +048-049: x 0f # data[1] = 15 [82 overall] +049-050: x 17 # data[2] = 23 [90 overall] +050-051: x 1d # data[3] = 29 [96 overall] +051-052: x 26 # data[4] = 38 [105 overall] +052-053: x 2e # data[5] = 46 [113 overall] +053-054: x 33 # data[6] = 51 [118 overall] +054-055: x 3b # data[7] = 59 [126 overall] +055-056: x 42 # data[8] = 66 [133 overall] +056-057: x 48 # data[9] = 72 [139 overall] +057-058: x 4c # data[10] = 76 [143 overall] +058-059: x 56 # data[11] = 86 [153 overall] +059-060: x 5c # data[12] = 92 [159 overall] +060-061: x 63 # data[13] = 99 [166 overall] +061-062: x 69 # data[14] = 105 [172 overall] +062-063: x 6f # data[15] = 111 [178 overall] +063-064: x 76 # data[16] = 118 [185 overall] +064-065: x 7e # data[17] = 126 [193 overall] +065-066: x 84 # data[18] = 132 [199 overall] +066-067: x 84 # data[19] = 132 [199 overall] # Data -063-073: x 61616161616161616161 # data[00]: aaaaaaaaaaaaaaa (block prefix) -073-078: x 6161616161 # (continued...) -078-078: x # data[01]: ............... (bundle prefix) -078-086: x 7070616c6c696e67 # data[02]: ...............ppalling -086-092: x 70706172656c # data[03]: ...............pparel -092-101: x 707061726974696f6e # data[04]: ...............pparition -101-109: x 7070656172696e67 # data[05]: ...............ppearing -109-114: x 7070656e64 # data[06]: ...............ppend -114-122: x 7070656e64616765 # data[07]: ...............ppendage -122-129: x 7070656e646978 # data[08]: ...............ppendix -129-135: x 70706c617564 # data[09]: ...............pplaud -135-139: x 70706c65 # data[10]: ...............pple -139-149: x 70706c69636174696f6e # data[11]: ...............pplication -149-155: x 70706c696564 # data[12]: ...............pplied -155-162: x 70706c79696e67 # data[13]: ...............pplying -162-168: x 70706f696e74 # data[14]: ...............ppoint -168-174: x 70706f736573 # data[15]: ...............pposes -174-181: x 7070726f766573 # data[16]: ...............pproves -181-189: x 7272657374696e67 # data[17]: ...............rresting -189-195: x 727269766564 # data[18]: ...............rrived (bundle prefix) -195-195: x # data[19]: ..................... +067-077: x 61616161616161616161 # data[00]: aaaaaaaaaaaaaaa (block prefix) +077-082: x 6161616161 # (continued...) +082-082: x # data[01]: ............... (bundle prefix) +082-090: x 7070616c6c696e67 # data[02]: ...............ppalling +090-096: x 70706172656c # data[03]: ...............pparel +096-105: x 707061726974696f6e # data[04]: ...............pparition +105-113: x 7070656172696e67 # data[05]: ...............ppearing +113-118: x 7070656e64 # data[06]: ...............ppend +118-126: x 7070656e64616765 # data[07]: ...............ppendage +126-133: x 7070656e646978 # data[08]: ...............ppendix +133-139: x 70706c617564 # data[09]: ...............pplaud +139-143: x 70706c65 # data[10]: ...............pple +143-153: x 70706c69636174696f6e # data[11]: ...............pplication +153-159: x 70706c696564 # data[12]: ...............pplied +159-166: x 70706c79696e67 # data[13]: ...............pplying +166-172: x 70706f696e74 # data[14]: ...............ppoint +172-178: x 70706f736573 # data[15]: ...............pposes +178-185: x 7070726f766573 # data[16]: ...............pproves +185-193: x 7272657374696e67 # data[17]: ...............rresting +193-199: x 727269766564 # data[18]: ...............rrived (bundle prefix) +199-199: x # data[19]: ..................... # data for column 1 # rawbytes # offsets table -195-196: x 02 # delta encoding: delta8 -196-200: x 00000000 # 32-bit constant: 0 -200-201: x 00 # data[0] = 0 [218 overall] -201-202: x 03 # data[1] = 3 [221 overall] -202-203: x 06 # data[2] = 6 [224 overall] -203-204: x 09 # data[3] = 9 [227 overall] -204-205: x 0c # data[4] = 12 [230 overall] -205-206: x 0f # data[5] = 15 [233 overall] -206-207: x 12 # data[6] = 18 [236 overall] -207-208: x 15 # data[7] = 21 [239 overall] -208-209: x 18 # data[8] = 24 [242 overall] -209-210: x 1b # data[9] = 27 [245 overall] -210-211: x 1e # data[10] = 30 [248 overall] -211-212: x 21 # data[11] = 33 [251 overall] -212-213: x 24 # data[12] = 36 [254 overall] -213-214: x 27 # data[13] = 39 [257 overall] -214-215: x 2a # data[14] = 42 [260 overall] -215-216: x 2d # data[15] = 45 [263 overall] -216-217: x 30 # data[16] = 48 [266 overall] -217-218: x 33 # data[17] = 51 [269 overall] +199-200: x 02 # delta encoding: delta8 +200-204: x 00000000 # 32-bit constant: 0 +204-205: x 00 # data[0] = 0 [222 overall] +205-206: x 03 # data[1] = 3 [225 overall] +206-207: x 06 # data[2] = 6 [228 overall] +207-208: x 09 # data[3] = 9 [231 overall] +208-209: x 0c # data[4] = 12 [234 overall] +209-210: x 0f # data[5] = 15 [237 overall] +210-211: x 12 # data[6] = 18 [240 overall] +211-212: x 15 # data[7] = 21 [243 overall] +212-213: x 18 # data[8] = 24 [246 overall] +213-214: x 1b # data[9] = 27 [249 overall] +214-215: x 1e # data[10] = 30 [252 overall] +215-216: x 21 # data[11] = 33 [255 overall] +216-217: x 24 # data[12] = 36 [258 overall] +217-218: x 27 # data[13] = 39 [261 overall] +218-219: x 2a # data[14] = 42 [264 overall] +219-220: x 2d # data[15] = 45 [267 overall] +220-221: x 30 # data[16] = 48 [270 overall] +221-222: x 33 # data[17] = 51 [273 overall] # data -218-221: x 403130 # data[0]: @10 -221-224: x 403130 # data[1]: @10 -224-227: x 403130 # data[2]: @10 -227-230: x 403130 # data[3]: @10 -230-233: x 403130 # data[4]: @10 -233-236: x 403130 # data[5]: @10 -236-239: x 403130 # data[6]: @10 -239-242: x 403130 # data[7]: @10 -242-245: x 403130 # data[8]: @10 -245-248: x 403130 # data[9]: @10 -248-251: x 403130 # data[10]: @10 -251-254: x 403130 # data[11]: @10 -254-257: x 403130 # data[12]: @10 -257-260: x 403130 # data[13]: @10 -260-263: x 403130 # data[14]: @10 -263-266: x 403130 # data[15]: @10 -266-269: x 403130 # data[16]: @10 +222-225: x 403130 # data[0]: @10 +225-228: x 403130 # data[1]: @10 +228-231: x 403130 # data[2]: @10 +231-234: x 403130 # data[3]: @10 +234-237: x 403130 # data[4]: @10 +237-240: x 403130 # data[5]: @10 +240-243: x 403130 # data[6]: @10 +243-246: x 403130 # data[7]: @10 +246-249: x 403130 # data[8]: @10 +249-252: x 403130 # data[9]: @10 +252-255: x 403130 # data[10]: @10 +255-258: x 403130 # data[11]: @10 +258-261: x 403130 # data[12]: @10 +261-264: x 403130 # data[13]: @10 +264-267: x 403130 # data[14]: @10 +267-270: x 403130 # data[15]: @10 +270-273: x 403130 # data[16]: @10 # data for column 2 -269-270: x 01 # delta encoding: const -270-278: x 0100000000000000 # 64-bit constant: 1 +273-274: x 01 # delta encoding: const +274-282: x 0100000000000000 # 64-bit constant: 1 # data for column 3 -278-280: x 0000 # padding to align to 64-bit boundary -280-288: b 1111111111111111000000010000000000000000000000000000000000000000 # bitmap word 0 -288-296: b 0000000100000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 +282-288: x 000000000000 # padding to align to 64-bit boundary +288-296: b 1111111111111111000000010000000000000000000000000000000000000000 # bitmap word 0 +296-304: b 0000000100000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 # data for column 4 # rawbytes # offsets table -296-297: x 02 # delta encoding: delta8 -297-301: x 00000000 # 32-bit constant: 0 -301-302: x 00 # data[0] = 0 [319 overall] -302-303: x 01 # data[1] = 1 [320 overall] -303-304: x 02 # data[2] = 2 [321 overall] -304-305: x 03 # data[3] = 3 [322 overall] -305-306: x 04 # data[4] = 4 [323 overall] -306-307: x 05 # data[5] = 5 [324 overall] -307-308: x 06 # data[6] = 6 [325 overall] -308-309: x 07 # data[7] = 7 [326 overall] -309-310: x 08 # data[8] = 8 [327 overall] -310-311: x 09 # data[9] = 9 [328 overall] -311-312: x 0a # data[10] = 10 [329 overall] -312-313: x 0b # data[11] = 11 [330 overall] -313-314: x 0c # data[12] = 12 [331 overall] -314-315: x 0d # data[13] = 13 [332 overall] -315-316: x 0e # data[14] = 14 [333 overall] -316-317: x 0f # data[15] = 15 [334 overall] -317-318: x 10 # data[16] = 16 [335 overall] -318-319: x 11 # data[17] = 17 [336 overall] +304-305: x 02 # delta encoding: delta8 +305-309: x 00000000 # 32-bit constant: 0 +309-310: x 00 # data[0] = 0 [327 overall] +310-311: x 01 # data[1] = 1 [328 overall] +311-312: x 02 # data[2] = 2 [329 overall] +312-313: x 03 # data[3] = 3 [330 overall] +313-314: x 04 # data[4] = 4 [331 overall] +314-315: x 05 # data[5] = 5 [332 overall] +315-316: x 06 # data[6] = 6 [333 overall] +316-317: x 07 # data[7] = 7 [334 overall] +317-318: x 08 # data[8] = 8 [335 overall] +318-319: x 09 # data[9] = 9 [336 overall] +319-320: x 0a # data[10] = 10 [337 overall] +320-321: x 0b # data[11] = 11 [338 overall] +321-322: x 0c # data[12] = 12 [339 overall] +322-323: x 0d # data[13] = 13 [340 overall] +323-324: x 0e # data[14] = 14 [341 overall] +324-325: x 0f # data[15] = 15 [342 overall] +325-326: x 10 # data[16] = 16 [343 overall] +326-327: x 11 # data[17] = 17 [344 overall] # data -319-320: x 61 # data[0]: a -320-321: x 61 # data[1]: a -321-322: x 61 # data[2]: a -322-323: x 61 # data[3]: a -323-324: x 61 # data[4]: a -324-325: x 61 # data[5]: a -325-326: x 61 # data[6]: a -326-327: x 61 # data[7]: a -327-328: x 61 # data[8]: a -328-329: x 61 # data[9]: a -329-330: x 61 # data[10]: a -330-331: x 61 # data[11]: a -331-332: x 61 # data[12]: a -332-333: x 61 # data[13]: a -333-334: x 61 # data[14]: a -334-335: x 61 # data[15]: a -335-336: x 61 # data[16]: a +327-328: x 61 # data[0]: a +328-329: x 61 # data[1]: a +329-330: x 61 # data[2]: a +330-331: x 61 # data[3]: a +331-332: x 61 # data[4]: a +332-333: x 61 # data[5]: a +333-334: x 61 # data[6]: a +334-335: x 61 # data[7]: a +335-336: x 61 # data[8]: a +336-337: x 61 # data[9]: a +337-338: x 61 # data[10]: a +338-339: x 61 # data[11]: a +339-340: x 61 # data[12]: a +340-341: x 61 # data[13]: a +341-342: x 61 # data[14]: a +342-343: x 61 # data[15]: a +343-344: x 61 # data[16]: a # data for column 5 -336-344: b 0000000000000000000000000000000000000000000000000000000000000000 # bitmap word 0 -344-352: b 0000000000000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 +344-352: b 0000000000000000000000000000000000000000000000000000000000000000 # bitmap word 0 +352-360: b 0000000000000000000000000000000000000000000000000000000000000000 # bitmap summary word 0-63 iter seek-ge aaa diff --git a/sstable/colblk/unsafe_slice.go b/sstable/colblk/unsafe_slice.go index 74729bfd0d..a4a6f2f9ba 100644 --- a/sstable/colblk/unsafe_slice.go +++ b/sstable/colblk/unsafe_slice.go @@ -143,6 +143,13 @@ type UnsafeBuf struct { cap int } +// Alloc allocates a buffer of size n, without zeroing its contents or copying +// previous buffer contents. +func (b *UnsafeBuf) Alloc(n int) { + b.ptr = mallocgc(uintptr(n), nil, false) + b.cap = n +} + // UnsafeSlice returns the current contents of the buf. func (b *UnsafeBuf) UnsafeSlice() []byte { return unsafe.Slice((*byte)(b.ptr), b.len)