private static Type pigTypeToProtoType ( byte pigTypeId ) { switch ( pigTypeId ) { case DataType . BOOLEAN : return Type . TYPE_BOOL ; case DataType . INTEGER : return Type . TYPE_INT32 ; case DataType . LONG : return Type . TYPE_INT64 ; case DataType . FLOAT : return Type . TYPE_FLOAT ; case DataType . DOUBLE : return Type . TYPE_DOUBLE ; case DataType . CHARARRAY : return Type . TYPE_STRING ; case DataType . BYTEARRAY : return Type . TYPE_BYTES ; default : throw new IllegalArgumentException ( "Unsupported Pig type passed (" + pigTypeId + ") where a simple type is expected while converting Pig to a dynamic Protobuf" ) ; } }
For a given Pig type return the protobufs type that maps to it .