avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Porter <gmpor...@gmail.com>
Subject Re: Type unsupported: string error with Schema.java:704
Date Mon, 03 Aug 2009 20:33:38 GMT
I ran into this exact same error for a simple key/value store I was
writing.  I ended up getting rid of the named types ("RequestID" and
"ClientID") and just made the method signature take a string (in this
case).

I'd be interested in finding out what solution you came across for
this.  I'm a JSON novice so I wasn't sure if the issue was in Avro or
JSON.

Thanks,
-George

On Mon, Aug 3, 2009 at 12:27 PM, tazan007<tazan007@gmail.com> wrote:
> Hi guys, I am getting this error with the following schema:
>
> {"namespace": "rpc.test",
>  "protocol": "ds_rpc",
>
> "types": [
>      {"name": "RequestID", "type": "string"},
>      {"name": "ClientID", "type": "string"}
>  ],
>
>  "messages": {
>
>      "helo": {
>          "request": [{"name": "helo", "type": "ClientID"}],
>          "response": "RequestID"
>      }
>  }
>
> }
>
> throws this error:
>
> Caused by: org.apache.avro.SchemaParseException: Type not yet supported:
> string
>     at org.apache.avro.Schema.parse(Schema.java:704)
>     at org.apache.avro.Protocol.parseTypes(Protocol.java:279)
>     at org.apache.avro.Protocol.parse(Protocol.java:253)
>     at org.apache.avro.Protocol.parse(Protocol.java:243)
>     at org.apache.avro.Protocol.parse(Protocol.java:227)
>
> If I change the types to the following, it fixes the error:
>
> {"namespace": "rpc.test",
>  "protocol": "ds_rpc",
>
> "types": [
>      {"name": "RequestID", "type":"record", "fields" : [
>                         {"name":"id","type": "string"}]},
>      {"name": "ClientID", "type":"record", "fields" : [
>                         {"name":"id","type": "string"}]}
>  ],
>
>  "messages": {
>
>      "helo": {
>          "request": [{"name": "helo", "type": "ClientID"}],
>          "response": "RequestID"
>      }
>  }
>
> }
>
>
> Is this expeceted behavior?  Do the types have to be complex if they are
> named types?
>
> Thanks,
> Hiral
>

Mime
View raw message