I found the source code is very helpful for this.
There's a custom serde in the source, with a test case you can review, which
really speeds up development of your SerDe.
org.apache.hadoop.hive.contrib.serde2.TestRegexSerDe
One thing to watch out for though, is that the framework will down-case the
field names when they are passed to the SerDe.
This is a documented feature, but I didn't discover it until I put debugging
in my code.
The following is useful for debugging your SerDe:
throw new SerDeException("some state information");
On Fri, Jan 21, 2011 at 3:09 PM, ankit bhatnagar <[email protected]>wrote:
> Hi All,
>
> Just wondering if someone can throw some light on the fact how are the
> column names and types are provided to Deserializer while creating table.
>
>
> @Override
> public void initialize(Configuration conf, Properties tbl)
> throws SerDeException {
>
> }
> I understand that above accept that info - but my question will be how is
> this initialize() method getting invoked with Custom SerDe while executing
> query.
>
> create table my_table(a string, b string, ...)
>
> row format serde '..CustomSerde'
> stored as textfile
> ;
>
>
>
> Thanks
> -Ankit
>