mirror of
https://github.com/microsoft/HybridRow.git
synced 2026-01-31 07:13:19 +00:00
RowIterable and RowScanner now support additional data types
This commit is contained in:
@@ -155,10 +155,18 @@ public class RowIterable implements AutoCloseable, Iterable<DataItem> {
|
|||||||
|
|
||||||
switch (type.layoutCode()) {
|
switch (type.layoutCode()) {
|
||||||
|
|
||||||
|
case NULL: {
|
||||||
|
result = this.reader.readNull(this.value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case BOOLEAN: {
|
case BOOLEAN: {
|
||||||
result = this.reader.readBoolean(this.value);
|
result = this.reader.readBoolean(this.value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case INT_8: {
|
||||||
|
result = this.reader.readInt8(this.value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case INT_16: {
|
case INT_16: {
|
||||||
result = this.reader.readInt16(this.value);
|
result = this.reader.readInt16(this.value);
|
||||||
break;
|
break;
|
||||||
@@ -171,10 +179,18 @@ public class RowIterable implements AutoCloseable, Iterable<DataItem> {
|
|||||||
result = this.reader.readInt64(this.value);
|
result = this.reader.readInt64(this.value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case VAR_INT: {
|
||||||
|
result = this.reader.readVarInt(this.value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case UINT_8: {
|
case UINT_8: {
|
||||||
result = this.reader.readUInt8(this.value);
|
result = this.reader.readUInt8(this.value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case UINT_16: {
|
||||||
|
result = this.reader.readUInt16(this.value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case UINT_32: {
|
case UINT_32: {
|
||||||
result = this.reader.readUInt32(this.value);
|
result = this.reader.readUInt32(this.value);
|
||||||
break;
|
break;
|
||||||
@@ -183,28 +199,44 @@ public class RowIterable implements AutoCloseable, Iterable<DataItem> {
|
|||||||
result = this.reader.readUInt64(this.value);
|
result = this.reader.readUInt64(this.value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BINARY: {
|
case VAR_UINT: {
|
||||||
result = this.reader.readBinary(this.value);
|
result = this.reader.readVarUInt(this.value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case FLOAT_32: {
|
||||||
|
result = this.reader.readFloat32(this.value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case FLOAT_64: {
|
||||||
|
result = this.reader.readFloat64(this.value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case FLOAT_128: {
|
||||||
|
result = this.reader.readFloat128(this.value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DECIMAL: {
|
||||||
|
result = this.reader.readDecimal(this.value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GUID: {
|
case GUID: {
|
||||||
result = this.reader.readGuid(this.value);
|
result = this.reader.readGuid(this.value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NULL:
|
case DATE_TIME: {
|
||||||
case BOOLEAN_FALSE:
|
result = this.reader.readDateTime(this.value);
|
||||||
case INT_8:
|
break;
|
||||||
case UINT_16:
|
}
|
||||||
case VAR_INT:
|
case UNIX_DATE_TIME: {
|
||||||
case VAR_UINT:
|
result = this.reader.readUnixDateTime(this.value);
|
||||||
case FLOAT_32:
|
break;
|
||||||
case FLOAT_64:
|
}
|
||||||
case FLOAT_128:
|
case BINARY: {
|
||||||
case DECIMAL:
|
result = this.reader.readBinary(this.value);
|
||||||
case DATE_TIME:
|
break;
|
||||||
case UNIX_DATE_TIME:
|
}
|
||||||
case UTF_8: {
|
case UTF_8: {
|
||||||
result = Result.SUCCESS;
|
result = this.reader.readUtf8String(this.value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NULLABLE_SCOPE:
|
case NULLABLE_SCOPE:
|
||||||
@@ -262,6 +294,7 @@ public class RowIterable implements AutoCloseable, Iterable<DataItem> {
|
|||||||
case MONGODB_OBJECT_ID: {
|
case MONGODB_OBJECT_ID: {
|
||||||
throw new IllegalStateException(lenientFormat("unsupported layout type: %s", type));
|
throw new IllegalStateException(lenientFormat("unsupported layout type: %s", type));
|
||||||
}
|
}
|
||||||
|
case BOOLEAN_FALSE:
|
||||||
case END_SCOPE:
|
case END_SCOPE:
|
||||||
case INVALID: {
|
case INVALID: {
|
||||||
throw new IllegalStateException(lenientFormat("unexpected layout type: %s", type));
|
throw new IllegalStateException(lenientFormat("unexpected layout type: %s", type));
|
||||||
|
|||||||
@@ -104,10 +104,18 @@ public class RowScanner implements AutoCloseable {
|
|||||||
|
|
||||||
switch (type.layoutCode()) {
|
switch (type.layoutCode()) {
|
||||||
|
|
||||||
|
case NULL: {
|
||||||
|
result = reader.readNull(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case BOOLEAN: {
|
case BOOLEAN: {
|
||||||
result = reader.readBoolean(value);
|
result = reader.readBoolean(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case INT_8: {
|
||||||
|
result = reader.readInt8(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case INT_16: {
|
case INT_16: {
|
||||||
result = reader.readInt16(value);
|
result = reader.readInt16(value);
|
||||||
break;
|
break;
|
||||||
@@ -120,10 +128,18 @@ public class RowScanner implements AutoCloseable {
|
|||||||
result = reader.readInt64(value);
|
result = reader.readInt64(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case VAR_INT: {
|
||||||
|
result = reader.readVarInt(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case UINT_8: {
|
case UINT_8: {
|
||||||
result = reader.readUInt8(value);
|
result = reader.readUInt8(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case UINT_16: {
|
||||||
|
result = reader.readUInt16(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case UINT_32: {
|
case UINT_32: {
|
||||||
result = reader.readUInt32(value);
|
result = reader.readUInt32(value);
|
||||||
break;
|
break;
|
||||||
@@ -132,28 +148,44 @@ public class RowScanner implements AutoCloseable {
|
|||||||
result = reader.readUInt64(value);
|
result = reader.readUInt64(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BINARY: {
|
case VAR_UINT: {
|
||||||
result = reader.readBinary(value);
|
result = reader.readVarUInt(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case FLOAT_32: {
|
||||||
|
result = reader.readFloat32(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case FLOAT_64: {
|
||||||
|
result = reader.readFloat64(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case FLOAT_128: {
|
||||||
|
result = reader.readFloat128(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DECIMAL: {
|
||||||
|
result = reader.readDecimal(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GUID: {
|
case GUID: {
|
||||||
result = reader.readGuid(value);
|
result = reader.readGuid(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NULL:
|
case DATE_TIME: {
|
||||||
case BOOLEAN_FALSE:
|
result = reader.readDateTime(value);
|
||||||
case INT_8:
|
break;
|
||||||
case UINT_16:
|
}
|
||||||
case VAR_INT:
|
case UNIX_DATE_TIME: {
|
||||||
case VAR_UINT:
|
result = reader.readUnixDateTime(value);
|
||||||
case FLOAT_32:
|
break;
|
||||||
case FLOAT_64:
|
}
|
||||||
case FLOAT_128:
|
case BINARY: {
|
||||||
case DECIMAL:
|
result = reader.readBinary(value);
|
||||||
case DATE_TIME:
|
break;
|
||||||
case UNIX_DATE_TIME:
|
}
|
||||||
case UTF_8: {
|
case UTF_8: {
|
||||||
result = Result.SUCCESS;
|
result = reader.readUtf8String(value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NULLABLE_SCOPE:
|
case NULLABLE_SCOPE:
|
||||||
@@ -212,13 +244,14 @@ public class RowScanner implements AutoCloseable {
|
|||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case END_SCOPE: {
|
|
||||||
throw new IllegalStateException(lenientFormat("unexpected layout type: %s", type));
|
|
||||||
}
|
|
||||||
case INVALID:
|
|
||||||
case MONGODB_OBJECT_ID: {
|
case MONGODB_OBJECT_ID: {
|
||||||
throw new IllegalStateException(lenientFormat("unsupported layout type: %s", type));
|
throw new IllegalStateException(lenientFormat("unsupported layout type: %s", type));
|
||||||
}
|
}
|
||||||
|
case BOOLEAN_FALSE:
|
||||||
|
case END_SCOPE:
|
||||||
|
case INVALID: {
|
||||||
|
throw new IllegalStateException(lenientFormat("unexpected layout type: %s", type));
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
throw new IllegalStateException(lenientFormat("unknown layout type: %s", type));
|
throw new IllegalStateException(lenientFormat("unknown layout type: %s", type));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user