public ColumnDescriptor(TColumnDesc tColumnDesc) { name = tColumnDesc.getColumnName(); comment = tColumnDesc.getComment(); type = new TypeDescriptor(tColumnDesc.getTypeDesc()); position = tColumnDesc.getPosition(); }
public TColumnDesc toTColumnDesc() { TColumnDesc tColumnDesc = new TColumnDesc(); tColumnDesc.setColumnName(name); tColumnDesc.setComment(comment); tColumnDesc.setTypeDesc(type.toTTypeDesc()); tColumnDesc.setPosition(position); return tColumnDesc; }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof TColumnDesc) return this.equals((TColumnDesc)that); return false; }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case COLUMN_NAME: return isSetColumnName(); case TYPE_DESC: return isSetTypeDesc(); case POSITION: return isSetPosition(); case COMMENT: return isSetComment(); } throw new IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public TColumnDesc(TColumnDesc other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetColumnName()) { this.columnName = other.columnName; } if (other.isSetTypeDesc()) { this.typeDesc = new TTypeDesc(other.typeDesc); } this.position = other.position; if (other.isSetComment()) { this.comment = other.comment; } }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetColumnName()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnName' is unset! Struct:" + toString()); } if (!isSetTypeDesc()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeDesc' is unset! Struct:" + toString()); } if (!isSetPosition()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'position' is unset! Struct:" + toString()); } // check for sub-struct validity if (typeDesc != null) { typeDesc.validate(); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list43 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.columns = new ArrayList<TColumnDesc>(_list43.size); for (int _i44 = 0; _i44 < _list43.size; ++_i44) { TColumnDesc _elem45; // optional _elem45 = new TColumnDesc(); _elem45.read(iprot); struct.columns.add(_elem45); } } struct.setColumnsIsSet(true); } }
typesSb.append(","); String columnName = columns.get(pos).getColumnName(); columnNames.add(columnName); normalizedColumnNames.add(columnName.toLowerCase()); TPrimitiveTypeEntry primitiveTypeEntry = columns.get(pos).getTypeDesc().getTypes().get(0).getPrimitiveEntry(); String columnTypeName = TYPE_NAMES.get(primitiveTypeEntry.getType()); columnTypes.add(columnTypeName);
public void write(org.apache.thrift.protocol.TProtocol oprot, TColumnDesc struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.columnName != null) { oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); oprot.writeString(struct.columnName); oprot.writeFieldEnd(); } if (struct.typeDesc != null) { oprot.writeFieldBegin(TYPE_DESC_FIELD_DESC); struct.typeDesc.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(POSITION_FIELD_DESC); oprot.writeI32(struct.position); oprot.writeFieldEnd(); if (struct.comment != null) { if (struct.isSetComment()) { oprot.writeFieldBegin(COMMENT_FIELD_DESC); oprot.writeString(struct.comment); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
public TColumnDesc deepCopy() { return new TColumnDesc(this); }
sb.append(this.position); first = false; if (isSetComment()) { if (!first) sb.append(", "); sb.append("comment:");
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case COLUMN_NAME: return isSetColumnName(); case TYPE_DESC: return isSetTypeDesc(); case POSITION: return isSetPosition(); case COMMENT: return isSetComment(); } throw new IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public TColumnDesc(TColumnDesc other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetColumnName()) { this.columnName = other.columnName; } if (other.isSetTypeDesc()) { this.typeDesc = new TTypeDesc(other.typeDesc); } this.position = other.position; if (other.isSetComment()) { this.comment = other.comment; } }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetColumnName()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnName' is unset! Struct:" + toString()); } if (!isSetTypeDesc()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeDesc' is unset! Struct:" + toString()); } if (!isSetPosition()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'position' is unset! Struct:" + toString()); } // check for sub-struct validity if (typeDesc != null) { typeDesc.validate(); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list43 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.columns = new ArrayList<TColumnDesc>(_list43.size); for (int _i44 = 0; _i44 < _list43.size; ++_i44) { TColumnDesc _elem45; // optional _elem45 = new TColumnDesc(); _elem45.read(iprot); struct.columns.add(_elem45); } } struct.setColumnsIsSet(true); } }
typesSb.append(","); String columnName = columns.get(pos).getColumnName(); columnNames.add(columnName); normalizedColumnNames.add(columnName.toLowerCase()); TPrimitiveTypeEntry primitiveTypeEntry = columns.get(pos).getTypeDesc().getTypes().get(0).getPrimitiveEntry(); String columnTypeName = TYPE_NAMES.get(primitiveTypeEntry.getType()); columnTypes.add(columnTypeName);
public void write(org.apache.thrift.protocol.TProtocol oprot, TColumnDesc struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.columnName != null) { oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); oprot.writeString(struct.columnName); oprot.writeFieldEnd(); } if (struct.typeDesc != null) { oprot.writeFieldBegin(TYPE_DESC_FIELD_DESC); struct.typeDesc.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(POSITION_FIELD_DESC); oprot.writeI32(struct.position); oprot.writeFieldEnd(); if (struct.comment != null) { if (struct.isSetComment()) { oprot.writeFieldBegin(COMMENT_FIELD_DESC); oprot.writeString(struct.comment); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
public TColumnDesc deepCopy() { return new TColumnDesc(this); }
sb.append(this.position); first = false; if (isSetComment()) { if (!first) sb.append(", "); sb.append("comment:");
public Object getFieldValue(_Fields field) { switch (field) { case COLUMN_NAME: return getColumnName(); case TYPE_DESC: return getTypeDesc(); case POSITION: return Integer.valueOf(getPosition()); case COMMENT: return getComment(); } throw new IllegalStateException(); }