case STRUCT: { ImmutableList.Builder<Field> builder = ImmutableList.builder(); List<SerializedField> childList = serializedField.getChildList(); Preconditions.checkState(childList.size() > 0, "children should start with validity vector buffer"); SerializedField bits = childList.get(0); final List<SerializedField> unionChilds = serializedField.getChild(1).getChildList(); final int typeIds[] = new int[unionChilds.size()]; for (int i=0; i < unionChilds.size(); i++) {
final List<SerializedField> childList = metadata.getChildList(); int bufOffset = 0; int readableBytes = buf.readableBytes();
public void load(SerializedField metadata, ArrowBuf buf) { final List<SerializedField> fields = metadata.getChildList(); structVector.valueCount = metadata.getValueCount(); int bufOffset = 0; for (final SerializedField child : fields) { final Field fieldDef = SerializedFieldHelper.create(child); FieldVector vector = structVector.getChild(fieldDef.getName()); if (vector == null) { // if we arrive here, we didn't have a matching vector. vector = BasicTypeHelper.getNewVector(fieldDef, structVector.allocator); structVector.putChild(fieldDef.getName(), vector); } if (child.getValueCount() == 0) { vector.clear(); } else { TypeHelper.load(vector, child, buf.slice(bufOffset, child.getBufferLength())); } bufOffset += child.getBufferLength(); } Preconditions.checkState(bufOffset == buf.capacity()); }
public void writeTo(io.protostuff.Output output, com.dremio.exec.proto.UserBitShared.SerializedField message) throws java.io.IOException { if(message.hasMajorType()) output.writeObject(1, message.getMajorType(), com.dremio.common.types.SchemaTypeProtos.MajorType.WRITE, false); if(message.hasNamePart()) output.writeObject(2, message.getNamePart(), com.dremio.exec.proto.SchemaUserBitShared.NamePart.WRITE, false); for(com.dremio.exec.proto.UserBitShared.SerializedField child : message.getChildList()) output.writeObject(3, child, com.dremio.exec.proto.SchemaUserBitShared.SerializedField.WRITE, true); if(message.hasValueCount()) output.writeInt32(4, message.getValueCount(), false); if(message.hasVarByteLength()) output.writeInt32(5, message.getVarByteLength(), false); if(message.hasBufferLength()) output.writeInt32(7, message.getBufferLength(), false); } public boolean isInitialized(com.dremio.exec.proto.UserBitShared.SerializedField message)