Schema with ListType

13 views
Skip to first unread message

Ernest Criss

unread,
Nov 16, 2011, 12:33:13 AM11/16/11
to thri...@googlegroups.com
Hi everyone. I'm new to ThriftDB. What is the correct way to write a schema that contains a ListType? The documentation doesn't seem to explain clearly. I tried the following:

{
    "__class__": "StructSchema",

    "testlist" : {
"__class__": "ListType",
"member_datatype": {
"__class__": "StringType"
}
}
}

The above returns the error:
{
    "__class__": "ClientErrorResponse",
    "message": "Validation error: AttributeDescriptor wasn't expecting key: 'member_datatype'"
}



Andres Morey

unread,
Nov 16, 2011, 10:51:51 AM11/16/11
to thri...@googlegroups.com
Hi Ernest,

Sorry for the confusion. The only thing you're missing is adding the ListType object to an AttributeDescriptor:

{
    "__class__": "StructSchema",
    "testlist" : {
"__class__": "AttributeDescriptor",
"datatype" : {
"__class__": "ListType",
"member_datatype": {"__class__": "StringType"}
}
}

I updated the docs with a better example:

Let me know if you have any other questions!

Andres

Ernest Criss

unread,
Nov 17, 2011, 2:09:56 AM11/17/11
to thri...@googlegroups.com
Got it to work now. Thanks for the quick reply.
Reply all
Reply to author
Forward
0 new messages