mirror of
https://github.com/microsoft/HybridRow.git
synced 2026-01-26 04:43:17 +00:00
testLoadSchmea passes
This commit is contained in:
@@ -103,7 +103,7 @@ public final class LayoutBit {
|
|||||||
/**
|
/**
|
||||||
* The number of bytes needed to hold all bits so far allocated.
|
* The number of bytes needed to hold all bits so far allocated.
|
||||||
*/
|
*/
|
||||||
public final int getNumBytes() {
|
public final int numBytes() {
|
||||||
return LayoutBit.divCeiling(this.next, Byte.SIZE);
|
return LayoutBit.divCeiling(this.next, Byte.SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ public final class LayoutBit {
|
|||||||
*
|
*
|
||||||
* @return The allocated bit.
|
* @return The allocated bit.
|
||||||
*/
|
*/
|
||||||
public final LayoutBit Allocate() {
|
public final LayoutBit allocate() {
|
||||||
return new LayoutBit(this.next++);
|
return new LayoutBit(this.next++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,16 +44,16 @@ public final class LayoutBuilder {
|
|||||||
LayoutColumn column;
|
LayoutColumn column;
|
||||||
if (type.isNull()) {
|
if (type.isNull()) {
|
||||||
checkArgument(nullable);
|
checkArgument(nullable);
|
||||||
LayoutBit nullBit = this.bitAllocator.Allocate();
|
LayoutBit nullBit = this.bitAllocator.allocate();
|
||||||
column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.FIXED, this.parent(),
|
column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.FIXED, this.parent(),
|
||||||
this.fixedCount, 0, nullBit, LayoutBit.INVALID, 0);
|
this.fixedCount, 0, nullBit, LayoutBit.INVALID, 0);
|
||||||
} else if (type.isBoolean()) {
|
} else if (type.isBoolean()) {
|
||||||
LayoutBit nullBit = nullable ? this.bitAllocator.Allocate() : LayoutBit.INVALID;
|
LayoutBit nullBit = nullable ? this.bitAllocator.allocate() : LayoutBit.INVALID;
|
||||||
LayoutBit boolbit = this.bitAllocator.Allocate();
|
LayoutBit boolbit = this.bitAllocator.allocate();
|
||||||
column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.FIXED, this.parent(),
|
column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.FIXED, this.parent(),
|
||||||
this.fixedCount, 0, nullBit, boolbit, 0);
|
this.fixedCount, 0, nullBit, boolbit, 0);
|
||||||
} else {
|
} else {
|
||||||
LayoutBit nullBit = nullable ? this.bitAllocator.Allocate() : LayoutBit.INVALID;
|
LayoutBit nullBit = nullable ? this.bitAllocator.allocate() : LayoutBit.INVALID;
|
||||||
column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.FIXED, this.parent(),
|
column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.FIXED, this.parent(),
|
||||||
this.fixedCount, this.fixedSize, nullBit, LayoutBit.INVALID, length);
|
this.fixedCount, this.fixedSize, nullBit, LayoutBit.INVALID, length);
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ public final class LayoutBuilder {
|
|||||||
checkArgument(type.allowVariable());
|
checkArgument(type.allowVariable());
|
||||||
|
|
||||||
LayoutColumn column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.VARIABLE, this.parent(),
|
LayoutColumn column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.VARIABLE, this.parent(),
|
||||||
this.varCount, this.varCount, this.bitAllocator.Allocate(), LayoutBit.INVALID, length);
|
this.varCount, this.varCount, this.bitAllocator.allocate(), LayoutBit.INVALID, length);
|
||||||
|
|
||||||
this.varCount++;
|
this.varCount++;
|
||||||
this.varColumns.add(column);
|
this.varColumns.add(column);
|
||||||
@@ -107,7 +107,7 @@ public final class LayoutBuilder {
|
|||||||
public Layout build() {
|
public Layout build() {
|
||||||
// Compute offset deltas. Offset bools by the present byte count, and fixed fields by the sum of the present
|
// Compute offset deltas. Offset bools by the present byte count, and fixed fields by the sum of the present
|
||||||
// and bool count.
|
// and bool count.
|
||||||
int fixedDelta = this.bitAllocator.getNumBytes();
|
int fixedDelta = this.bitAllocator.numBytes();
|
||||||
int varIndexDelta = this.fixedCount;
|
int varIndexDelta = this.fixedCount;
|
||||||
|
|
||||||
// Update the fixedColumns with the delta before freezing them.
|
// Update the fixedColumns with the delta before freezing them.
|
||||||
@@ -127,7 +127,7 @@ public final class LayoutBuilder {
|
|||||||
|
|
||||||
updatedColumns.addAll(this.sparseColumns);
|
updatedColumns.addAll(this.sparseColumns);
|
||||||
|
|
||||||
Layout layout = new Layout(this.name, this.schemaId, this.bitAllocator.getNumBytes(), this.fixedSize + fixedDelta, updatedColumns);
|
Layout layout = new Layout(this.name, this.schemaId, this.bitAllocator.numBytes(), this.fixedSize + fixedDelta, updatedColumns);
|
||||||
this.reset();
|
this.reset();
|
||||||
return layout;
|
return layout;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public final class StringToken implements Cloneable {
|
|||||||
private StringToken() {
|
private StringToken() {
|
||||||
this.id = 0L;
|
this.id = 0L;
|
||||||
this.path = Utf8String.EMPTY;
|
this.path = Utf8String.EMPTY;
|
||||||
this.varint = Unpooled.wrappedBuffer(new byte[1]).setInt(0, 0).asReadOnly();
|
this.varint = Unpooled.wrappedBuffer(new byte[1]).asReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNull() {
|
public boolean isNull() {
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ public final class StringTokenizer {
|
|||||||
public StringTokenizer() {
|
public StringTokenizer() {
|
||||||
|
|
||||||
this.tokens = new HashMap<>();
|
this.tokens = new HashMap<>();
|
||||||
this.tokens.put(Utf8String.EMPTY, new StringToken(0, Utf8String.EMPTY));
|
this.tokens.put(Utf8String.EMPTY, StringToken.NONE);
|
||||||
|
|
||||||
this.stringTokens = new HashMap<>();
|
this.stringTokens = new HashMap<>();
|
||||||
this.stringTokens.put("", new StringToken(0, Utf8String.EMPTY));
|
this.stringTokens.put("", StringToken.NONE);
|
||||||
|
|
||||||
this.strings = new ArrayList<>();
|
this.strings = new ArrayList<>();
|
||||||
this.strings.add(Utf8String.EMPTY);
|
this.strings.add(Utf8String.EMPTY);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import java.util.PrimitiveIterator;
|
|||||||
/**
|
/**
|
||||||
* The base class for property types both primitive and complex.
|
* The base class for property types both primitive and complex.
|
||||||
*/
|
*/
|
||||||
@JsonTypeInfo(use = Id.NAME, property = "type")
|
@JsonTypeInfo(use = Id.NAME, property = "type", visible = true)
|
||||||
@JsonSubTypes({
|
@JsonSubTypes({
|
||||||
// Composite types
|
// Composite types
|
||||||
@Type(value = ArrayPropertyType.class, name = "array"),
|
@Type(value = ArrayPropertyType.class, name = "array"),
|
||||||
|
|||||||
Reference in New Issue
Block a user