FAQ
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

Search Discussions

  • Ankit bhatnagar at Jan 24, 2011 at 4:41 pm
    Hi All,

    Whats the best way to add custom serde jar.

    looks like add jar says added successfully and I am able to list that jar in
    hive interface

    However Create table fails to find the class.

    Thanks
    Ankit
  • Phil young at Jan 28, 2011 at 9:57 pm
    My guess is that the add jar didn't contain a class with the same exact name
    of your SerDe.

    It would probably help to see the output of your command with logging

    hive -hiveconf hive.root.logger=INFO,console -e "
    your command;
    "







    On Mon, Jan 24, 2011 at 11:41 AM, ankit bhatnagar wrote:

    Hi All,

    Whats the best way to add custom serde jar.

    looks like add jar says added successfully and I am able to list that jar
    in hive interface

    However Create table fails to find the class.

    Thanks
    Ankit
  • Phil young at Jan 28, 2011 at 10:02 pm
    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 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshive, hadoop
postedJan 21, '11 at 8:09p
activeJan 28, '11 at 10:02p
posts4
users2
websitehive.apache.org

2 users in discussion

Ankit bhatnagar: 2 posts Phil young: 2 posts

People

Translate

site design / logo © 2021 Grokbase