pig/src/main/java/com/twitter/elephantbird/pig/util/ThriftToPig.java
private static Schema singleFieldToTupleSchema(String fieldName, Field field) throws FrontendException {
    switch (field.getType()) {
      case TType.STRUCT:
        return wrapInTupleIfPig9(toSchema(field.gettStructDescriptor()));
      case TType.LIST:
      case TType.SET:
      case TType.MAP:
        return wrapInTupleIfPig9(new Schema(singleFieldToFieldSchema(fieldName, field)));
      default:
        return wrapInTupleIfPig9(new Schema(new FieldSchema(fieldName, null, getPigDataType(field))));
    }
  }
private static Schema singleFieldToTupleSchema(String fieldName, Field field) throws FrontendException {
    switch (field.getType()) {
      case TType.STRUCT:
        return wrapInTupleIfPig9(toSchema(field.gettStructDescriptor()));
      case TType.LIST:
      case TType.SET:
      case TType.MAP:
        return wrapInTupleIfPig9(new Schema(singleFieldToFieldSchema(fieldName, field)));
      default:
        return wrapInTupleIfPig9(new Schema(new FieldSchema(fieldName, null, getPigDataType(field))));
    }
  }
private static Schema singleFieldToTupleSchema ( String fieldName , Field field ) throws FrontendException { switch ( field . getType ( ) ) { case TType . STRUCT : return wrapInTupleIfPig9 ( toSchema ( field . gettStructDescriptor ( ) ) ) ; case TType . LIST : case TType . SET : case TType . MAP : return wrapInTupleIfPig9 ( new Schema ( singleFieldToFieldSchema ( fieldName , field ) ) ) ; default : return wrapInTupleIfPig9 ( new Schema ( new FieldSchema ( fieldName , null , getPigDataType ( field ) ) ) ) ; } }
Returns a schema with single tuple (for Pig bags).
Returns a schema with single tuple ( for Pig bags ) .