开发者

Get names of field schema from Pig

I'm working on a JsonStorage for Pig. Everything works fine, but at least I need to get the names of the fields (i.e. crdate, name, positions) from the pig schema.

| A | crdate: bytearray | name: bytearray | positions: bytearray |

Actually I extend my class by StoreFunc that provides no function t开发者_如何学Co get the names of the fields.

public class PigJsonStorage extends StoreFunc { .. }

Can anybody help me :)


disclaimer: I'm a little new to pig myself, and haven't implemented a storage class yet.

It looks to me like StoreFunc has a method for this: StoreFunc.checkSchema(ResourceSchema s). I would think you could just capture the schema from that for use during the write.


There's a class JsonMetadata that returns ResourceSchema which has a method returning an array of fields.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜