public static TypeProtos.MajorType toMajorType(PrimitiveType.PrimitiveTypeName primitiveTypeName, int length, TypeProtos.DataMode mode, SchemaElement schemaElement, OptionManager options, Field arrowField, final boolean readInt96AsTimeStamp) { MinorType minorType = getMinorType(primitiveTypeName, length, schemaElement, options, arrowField, readInt96AsTimeStamp); TypeProtos.MajorType.Builder typeBuilder = TypeProtos.MajorType.newBuilder().setMinorType(minorType).setMode(mode); if (CoreDecimalUtility.isDecimalType(minorType)) { typeBuilder.setPrecision(schemaElement.getPrecision()).setScale(schemaElement.getScale()); } return typeBuilder.build(); } }
public Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); case TYPE_LENGTH: return getType_length(); case REPETITION_TYPE: return getRepetition_type(); case NAME: return getName(); case NUM_CHILDREN: return getNum_children(); case CONVERTED_TYPE: return getConverted_type(); case SCALE: return getScale(); case PRECISION: return getPrecision(); case FIELD_ID: return getField_id(); case LOGICAL_TYPE: return getLogicalType(); } throw new IllegalStateException(); }
public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); case TYPE_LENGTH: return getType_length(); case REPETITION_TYPE: return getRepetition_type(); case NAME: return getName(); case NUM_CHILDREN: return getNum_children(); case CONVERTED_TYPE: return getConverted_type(); case SCALE: return getScale(); case PRECISION: return getPrecision(); case FIELD_ID: return getField_id(); case LOGICAL_TYPE: return getLogicalType(); } throw new java.lang.IllegalStateException(); }
public static TypeProtos.MajorType toMajorType(PrimitiveType.PrimitiveTypeName primitiveTypeName, int length, TypeProtos.DataMode mode, SchemaElement schemaElement, OptionManager options) { ConvertedType convertedType = schemaElement.getConverted_type(); MinorType minorType = getMinorType(primitiveTypeName, length, convertedType, options); TypeProtos.MajorType.Builder typeBuilder = TypeProtos.MajorType.newBuilder().setMinorType(minorType).setMode(mode); if (Types.isDecimalType(minorType)) { int precision = schemaElement.getPrecision(); int scale = schemaElement.getScale(); typeBuilder.setPrecision(precision).setScale(scale); } return typeBuilder.build(); }