private String getPigScriptDataType(FieldDescriptor fieldDescriptor) {
    switch (fieldDescriptor.getType()) {
      case INT32:
      case UINT32:
      case SINT32:
      case FIXED32:
      case SFIXED32:
      case BOOL: // We convert booleans to ints for pig output.
        return "int";
      case INT64:
      case UINT64:
      case SINT64:
      case FIXED64:
      case SFIXED64:
        return "long";
      case FLOAT:
        return "float";
      case DOUBLE:
        return "double";
      case STRING:
      case ENUM: // We convert enums to strings for pig output.
        return "chararray";
      case BYTES:
        return "bytearray";
      case MESSAGE:
        throw new IllegalArgumentException("getPigScriptDataType called on field " + fieldDescriptor.getFullName() + " of type message.");
      default:
        throw new IllegalArgumentException("Unexpected field type. " + fieldDescriptor.toString() + " " + fieldDescriptor.getFullName() + " " + fieldDescriptor.getType());
    }
  }
private String getPigScriptDataType(FieldDescriptor fieldDescriptor) {
    switch (fieldDescriptor.getType()) {
      case INT32:
      case UINT32:
      case SINT32:
      case FIXED32:
      case SFIXED32:
      case BOOL: 
        return "int";
      case INT64:
      case UINT64:
      case SINT64:
      case FIXED64:
      case SFIXED64:
        return "long";
      case FLOAT:
        return "float";
      case DOUBLE:
        return "double";
      case STRING:
      case ENUM: 
        return "chararray";
      case BYTES:
        return "bytearray";
      case MESSAGE:
        throw new IllegalArgumentException("getPigScriptDataType called on field " + fieldDescriptor.getFullName() + " of type message.");
      default:
        throw new IllegalArgumentException("Unexpected field type. " + fieldDescriptor.toString() + " " + fieldDescriptor.getFullName() + " " + fieldDescriptor.getType());
    }
  }
private String getPigScriptDataType ( FieldDescriptor fieldDescriptor ) { switch ( fieldDescriptor . getType ( ) ) { case INT32 : case UINT32 : case SINT32 : case FIXED32 : case SFIXED32 : case BOOL : // We convert booleans to ints for pig output. return "int" ; case INT64 : case UINT64 : case SINT64 : case FIXED64 : case SFIXED64 : return "long" ; case FLOAT : return "float" ; case DOUBLE : return "double" ; case STRING : case ENUM : // We convert enums to strings for pig output. return "chararray" ; case BYTES : return "bytearray" ; case MESSAGE : throw new IllegalArgumentException ( "getPigScriptDataType called on field " + fieldDescriptor . getFullName ( ) + " of type message." ) ; default : throw new IllegalArgumentException ( "Unexpected field type. " + fieldDescriptor . toString ( ) + " " + fieldDescriptor . getFullName ( ) + " " + fieldDescriptor . getType ( ) ) ; } }
Translate between protobuf's datatype representation and Pig's datatype representation.
@param fieldDescriptor the descriptor object for the given field.
@return the byte representing the pig datatype for the given field type.
Translate between protobuf s datatype representation and Pig s datatype representation .