public static DataMode valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } return VALUES[desc.getIndex()]; }
.computeEnumSize(2, mode_.getNumber());
public static ObjectInspector getObjectInspector(DataMode mode, MinorType minorType, boolean varCharToStringReplacement) { try { if (mode == DataMode.REQUIRED) { if (OIMAP_REQUIRED.containsKey(minorType)) { if (varCharToStringReplacement && minorType == MinorType.VARCHAR) { return (ObjectInspector) ((Class) OIMAP_REQUIRED.get(minorType).toArray()[1]).newInstance(); } else { return (ObjectInspector) ((Class) OIMAP_REQUIRED.get(minorType).toArray()[0]).newInstance(); } } } else if (mode == DataMode.OPTIONAL) { if (OIMAP_OPTIONAL.containsKey(minorType)) { if (varCharToStringReplacement && minorType == MinorType.VARCHAR) { return (ObjectInspector) ((Class) OIMAP_OPTIONAL.get(minorType).toArray()[1]).newInstance(); } else { return (ObjectInspector) ((Class) OIMAP_OPTIONAL.get(minorType).toArray()[0]).newInstance(); } } } else { throw new UnsupportedOperationException("Repeated types are not supported as arguement to Hive UDFs"); } } catch(InstantiationException | IllegalAccessException e) { throw new RuntimeException("Failed to instantiate ObjectInspector", e); } throw new UnsupportedOperationException( String.format("Type %s[%s] not supported as arguement to Hive UDFs", minorType.toString(), mode.toString())); }
com.dremio.common.types.TypeProtos.DataMode value = com.dremio.common.types.TypeProtos.DataMode.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(2, rawValue);
throw new UnsupportedOperationException(String.format(UNSUPPORTED, type.getName(), mode.name())); case ARRAY: break; throw new UnsupportedOperationException(String.format(UNSUPPORTED, type.getName(), mode.name())); throw new UnsupportedOperationException(String.format(UNSUPPORTED, type.getName(), mode.name()));
break; case 2: builder.setMode(com.dremio.common.types.TypeProtos.DataMode.valueOf(input.readEnum())); break; case 3:
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, minorType_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeEnum(2, mode_.getNumber()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeInt32(3, width_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeInt32(4, precision_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeInt32(5, scale_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeInt32(6, timeZone_); } for (int i = 0; i < subType_.size(); i++) { output.writeEnum(7, subType_.get(i).getNumber()); } getUnknownFields().writeTo(output); }
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)
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); } public final com.google.protobuf.Descriptors.EnumDescriptor
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor
private InvalidAccessException newInvalidAccessException(String name) { return new InvalidAccessException( String.format( "Requesting value of type %s for an object of type %s:%s is not allowed.", name, getType().getMinorType().name(), getType().getMode().name())); } }