public static MaterializedField create(SerializedField serField) { LinkedHashSet<MaterializedField> children = new LinkedHashSet<>(); for (SerializedField sf : serField.getChildList()) { children.add(MaterializedField.create(sf)); } return new MaterializedField(serField.getNamePart().getName(), serField.getMajorType(), children); }
public Builder mergeFrom(org.apache.drill.exec.proto.UserBitShared.SerializedField other) { if (other == org.apache.drill.exec.proto.UserBitShared.SerializedField.getDefaultInstance()) return this; if (other.hasMajorType()) { mergeMajorType(other.getMajorType());
public static MaterializedField create(SerializedField serField) { LinkedHashSet<MaterializedField> children = new LinkedHashSet<>(); for (SerializedField sf : serField.getChildList()) { children.add(MaterializedField.create(sf)); } return new MaterializedField(serField.getNamePart().getName(), serField.getMajorType(), children); }
final MajorType majorType = field.getMajorType(); final MinorType minorType = majorType.getMinorType(); builder.setPrecision(Types.getPrecision(field.getMajorType()));
for (VectorWrapper<?> vw : loader) { final String field = vw.getValueVector().getMetadata().getNamePart().getName(); final TypeProtos.MinorType fieldMinorType = vw.getValueVector().getMetadata().getMajorType().getMinorType(); final Accessor accessor = vw.getValueVector().getAccessor(); final Object value = i < accessor.getValueCount() ? accessor.getObject(i) : null;
public Builder mergeFrom(org.apache.drill.exec.proto.UserBitShared.SerializedField other) { if (other == org.apache.drill.exec.proto.UserBitShared.SerializedField.getDefaultInstance()) return this; if (other.hasMajorType()) { mergeMajorType(other.getMajorType());
if (! currentChild.getType().equals(newChild.getMajorType())) { return false;
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserBitShared.SerializedField message) throws java.io.IOException { if(message.hasMajorType()) output.writeObject(1, message.getMajorType(), org.apache.drill.common.types.SchemaTypeProtos.MajorType.WRITE, false); if(message.hasNamePart()) output.writeObject(2, message.getNamePart(), org.apache.drill.exec.proto.SchemaUserBitShared.NamePart.WRITE, false); for(org.apache.drill.exec.proto.UserBitShared.SerializedField child : message.getChildList()) output.writeObject(3, child, org.apache.drill.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(org.apache.drill.exec.proto.UserBitShared.SerializedField message)
@Override public void load(UserBitShared.SerializedField metadata, DrillBuf buffer) { final UserBitShared.SerializedField offsetMetadata = metadata.getChild(0); offsets.load(offsetMetadata, buffer); final int offsetLength = offsetMetadata.getBufferLength(); final UserBitShared.SerializedField bitMetadata = metadata.getChild(1); final int bitLength = bitMetadata.getBufferLength(); bits.load(bitMetadata, buffer.slice(offsetLength, bitLength)); final UserBitShared.SerializedField vectorMetadata = metadata.getChild(2); if (isEmptyType()) { addOrGetVector(VectorDescriptor.create(vectorMetadata.getMajorType())); } final int vectorLength = vectorMetadata.getBufferLength(); vector.load(vectorMetadata, buffer.slice(offsetLength + bitLength, vectorLength)); }
private UserBitShared.SerializedField createDummyField(UserBitShared.SerializedField field) { UserBitShared.SerializedField.Builder newDummyFieldBuilder = UserBitShared.SerializedField.newBuilder() .setVarByteLength(0) .setBufferLength(0) .setValueCount(0) .setNamePart(field.getNamePart()) .setMajorType(field.getMajorType()); int index = 0; for (UserBitShared.SerializedField childField : field.getChildList()) { // make sure we make a copy of all children, so we do not corrupt the // original fieldList. This will recursively call itself. newDummyFieldBuilder.addChild(index, createDummyField(childField)); index++; } UserBitShared.SerializedField newDummyField = newDummyFieldBuilder.build(); return newDummyField; }
@Override public void load(UserBitShared.SerializedField metadata, DrillBuf buffer) { final UserBitShared.SerializedField offsetMetadata = metadata.getChild(0); offsets.load(offsetMetadata, buffer); final UserBitShared.SerializedField vectorMetadata = metadata.getChild(1); if (getDataVector() == DEFAULT_DATA_VECTOR) { addOrGetVector(VectorDescriptor.create(vectorMetadata.getMajorType())); } final int offsetLength = offsetMetadata.getBufferLength(); final int vectorLength = vectorMetadata.getBufferLength(); vector.load(vectorMetadata, buffer.slice(offsetLength, vectorLength)); }
@Override public TypeProtos.MajorType getType() { return v.getMetadata().getMajorType(); } }
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserBitShared.SerializedField message) throws java.io.IOException { if(message.hasMajorType()) output.writeObject(1, message.getMajorType(), org.apache.drill.common.types.SchemaTypeProtos.MajorType.WRITE, false); if(message.hasNamePart()) output.writeObject(2, message.getNamePart(), org.apache.drill.exec.proto.SchemaUserBitShared.NamePart.WRITE, false); for(org.apache.drill.exec.proto.UserBitShared.SerializedField child : message.getChildList()) output.writeObject(3, child, org.apache.drill.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(org.apache.drill.exec.proto.UserBitShared.SerializedField message)
@Override public void load(UserBitShared.SerializedField metadata, DrillBuf buffer) { final UserBitShared.SerializedField offsetMetadata = metadata.getChild(0); offsets.load(offsetMetadata, buffer); final int offsetLength = offsetMetadata.getBufferLength(); final UserBitShared.SerializedField bitMetadata = metadata.getChild(1); final int bitLength = bitMetadata.getBufferLength(); bits.load(bitMetadata, buffer.slice(offsetLength, bitLength)); final UserBitShared.SerializedField vectorMetadata = metadata.getChild(2); if (isEmptyType()) { addOrGetVector(VectorDescriptor.create(vectorMetadata.getMajorType())); } final int vectorLength = vectorMetadata.getBufferLength(); vector.load(vectorMetadata, buffer.slice(offsetLength + bitLength, vectorLength)); }
@Override public void load(UserBitShared.SerializedField metadata, DrillBuf buffer) { final UserBitShared.SerializedField offsetMetadata = metadata.getChild(0); offsets.load(offsetMetadata, buffer); final UserBitShared.SerializedField vectorMetadata = metadata.getChild(1); if (getDataVector() == DEFAULT_DATA_VECTOR) { addOrGetVector(VectorDescriptor.create(vectorMetadata.getMajorType())); } final int offsetLength = offsetMetadata.getBufferLength(); final int vectorLength = vectorMetadata.getBufferLength(); vector.load(vectorMetadata, buffer.slice(offsetLength, vectorLength)); }