private static MessageType readParquetSchema(List<SchemaElement> schema) { Iterator<SchemaElement> schemaIterator = schema.iterator(); SchemaElement rootSchema = schemaIterator.next(); Types.MessageTypeBuilder builder = Types.buildMessage(); readTypeSchema(builder, schemaIterator, rootSchema.getNum_children()); return builder.named(rootSchema.name); }
if (element.isSetType_length()) { primitiveBuilder.length(element.type_length); if (element.isSetPrecision()) { primitiveBuilder.precision(element.precision); if (element.isSetScale()) { primitiveBuilder.scale(element.scale); if (element.isSetConverted_type()) { typeBuilder.as(getOriginalType(element.converted_type)); if (element.isSetField_id()) { typeBuilder.id(element.field_id);
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TYPE: return isSetType(); case TYPE_LENGTH: return isSetType_length(); case REPETITION_TYPE: return isSetRepetition_type(); case NAME: return isSetName(); case NUM_CHILDREN: return isSetNum_children(); case CONVERTED_TYPE: return isSetConverted_type(); case SCALE: return isSetScale(); case PRECISION: return isSetPrecision(); case FIELD_ID: return isSetField_id(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); case TYPE_LENGTH: return new Integer(getType_length()); case REPETITION_TYPE: return getRepetition_type(); case NAME: return getName(); case NUM_CHILDREN: return new Integer(getNum_children()); case CONVERTED_TYPE: return getConverted_type(); case SCALE: return new Integer(getScale()); case PRECISION: return new Integer(getPrecision()); case FIELD_ID: return new Integer(getField_id()); } throw new IllegalStateException(); }
@Override public void visit(PrimitiveType primitiveType) { SchemaElement element = new SchemaElement(primitiveType.getName()); element.setRepetition_type(toParquetRepetition(primitiveType.getRepetition())); element.setType(getType(primitiveType.getPrimitiveTypeName())); if (primitiveType.getOriginalType() != null) { element.setConverted_type(getConvertedType(primitiveType.getOriginalType())); } if (primitiveType.getDecimalMetadata() != null) { element.setPrecision(primitiveType.getDecimalMetadata().getPrecision()); element.setScale(primitiveType.getDecimalMetadata().getScale()); } if (primitiveType.getTypeLength() > 0) { element.setType_length(primitiveType.getTypeLength()); } result.add(element); }
/** * Performs a deep copy on <i>other</i>. */ public SchemaElement(SchemaElement other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); if (other.isSetType()) { this.type = other.type; } this.type_length = other.type_length; if (other.isSetRepetition_type()) { this.repetition_type = other.repetition_type; } if (other.isSetName()) { this.name = other.name; } this.num_children = other.num_children; if (other.isSetConverted_type()) { this.converted_type = other.converted_type; } this.scale = other.scale; this.precision = other.precision; this.field_id = other.field_id; }
@Override public void visit(GroupType groupType) { SchemaElement element = new SchemaElement(groupType.getName()); element.setRepetition_type(toParquetRepetition(groupType.getRepetition())); if (groupType.getOriginalType() != null) { element.setConverted_type(getConvertedType(groupType.getOriginalType())); } visitChildren(result, groupType, element); }
_elem22 = new SchemaElement(); _elem22.read(iprot); this.schema.add(_elem22);
public SchemaElement deepCopy() { return new SchemaElement(this); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof SchemaElement) return this.equals((SchemaElement)that); return false; }
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TYPE: return isSetType(); case TYPE_LENGTH: return isSetType_length(); case REPETITION_TYPE: return isSetRepetition_type(); case NAME: return isSetName(); case NUM_CHILDREN: return isSetNum_children(); case CONVERTED_TYPE: return isSetConverted_type(); case SCALE: return isSetScale(); case PRECISION: return isSetPrecision(); case FIELD_ID: return isSetField_id(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); case TYPE_LENGTH: return new Integer(getType_length()); case REPETITION_TYPE: return getRepetition_type(); case NAME: return getName(); case NUM_CHILDREN: return new Integer(getNum_children()); case CONVERTED_TYPE: return getConverted_type(); case SCALE: return new Integer(getScale()); case PRECISION: return new Integer(getPrecision()); case FIELD_ID: return new Integer(getField_id()); } throw new IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public SchemaElement(SchemaElement other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); if (other.isSetType()) { this.type = other.type; } this.type_length = other.type_length; if (other.isSetRepetition_type()) { this.repetition_type = other.repetition_type; } if (other.isSetName()) { this.name = other.name; } this.num_children = other.num_children; if (other.isSetConverted_type()) { this.converted_type = other.converted_type; } this.scale = other.scale; this.precision = other.precision; this.field_id = other.field_id; }
_elem26 = new SchemaElement(); _elem26.read(iprot); this.schema.add(_elem26);
public SchemaElement deepCopy() { return new SchemaElement(this); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof SchemaElement) return this.equals((SchemaElement)that); return false; }
boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); if (this_present_type || that_present_type) { if (!(this_present_type && that_present_type)) boolean this_present_type_length = true && this.isSetType_length(); boolean that_present_type_length = true && that.isSetType_length(); if (this_present_type_length || that_present_type_length) { if (!(this_present_type_length && that_present_type_length)) boolean this_present_repetition_type = true && this.isSetRepetition_type(); boolean that_present_repetition_type = true && that.isSetRepetition_type(); if (this_present_repetition_type || that_present_repetition_type) { if (!(this_present_repetition_type && that_present_repetition_type)) boolean this_present_name = true && this.isSetName(); boolean that_present_name = true && that.isSetName(); if (this_present_name || that_present_name) { if (!(this_present_name && that_present_name)) boolean this_present_num_children = true && this.isSetNum_children(); boolean that_present_num_children = true && that.isSetNum_children(); if (this_present_num_children || that_present_num_children) { if (!(this_present_num_children && that_present_num_children)) boolean this_present_converted_type = true && this.isSetConverted_type(); boolean that_present_converted_type = true && that.isSetConverted_type(); if (this_present_converted_type || that_present_converted_type) { if (!(this_present_converted_type && that_present_converted_type))
getPrimitive(schemaElement.type), fromParquetRepetition(schemaElement.repetition_type)); if (schemaElement.isSetType_length()) { primitiveBuilder.length(schemaElement.type_length); if (schemaElement.isSetPrecision()) { primitiveBuilder.precision(schemaElement.precision); if (schemaElement.isSetScale()) { primitiveBuilder.scale(schemaElement.scale); if (schemaElement.isSetConverted_type()) { childBuilder.as(getOriginalType(schemaElement.converted_type)); if (schemaElement.isSetField_id()) { childBuilder.id(schemaElement.field_id);
MessageType fromParquetSchema(List<SchemaElement> schema) { Iterator<SchemaElement> iterator = schema.iterator(); SchemaElement root = iterator.next(); Types.MessageTypeBuilder builder = Types.buildMessage(); buildChildren(builder, iterator, root.getNum_children()); return builder.named(root.name); }
@Override public void visit(MessageType messageType) { SchemaElement element = new SchemaElement(messageType.getName()); visitChildren(result, messageType.asGroupType(), element); }