public static List<Field> getChildrenForMajorType(MajorType majorType) { List<Field> children = new ArrayList<>(); switch (majorType.getMinorType()) { case UNION: for (TypeProtos.MinorType minorType : majorType.getSubTypeList()) { children.add(Field.nullable("", getArrowMinorType(minorType).getType())); } return children; default: return Collections.emptyList(); } }
public void writeTo(io.protostuff.Output output, com.dremio.common.types.TypeProtos.MajorType message) throws java.io.IOException { if(message.hasMinorType()) output.writeEnum(1, message.getMinorType().getNumber(), false); if(message.hasMode()) output.writeEnum(2, message.getMode().getNumber(), false); if(message.hasWidth()) output.writeInt32(3, message.getWidth(), false); if(message.hasPrecision()) output.writeInt32(4, message.getPrecision(), false); if(message.hasScale()) output.writeInt32(5, message.getScale(), false); if(message.hasTimeZone()) output.writeInt32(6, message.getTimeZone(), false); for(com.dremio.common.types.TypeProtos.MinorType subType : message.getSubTypeList()) output.writeEnum(7, subType.getNumber(), true); } public boolean isInitialized(com.dremio.common.types.TypeProtos.MajorType message)