You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Jonathan Grimm <jg...@Endeca.com> on 2011/08/15 17:56:35 UTC

copy table, change serde

Hi,

 

I'm trying to do what I think should be a simple task, but I'm running
into some issues with carrying through column names.  All I want to do
is essentially copy an existing table but change the serialization
format (if you're curious, this is to help integrate with some existing
map reduce jobs).  I'm new to Hive, so perhaps I'm just missing
something simple.

 

I'm using the following, which runs through just fine without any errors
or anything:

create table compat row format serde 'com.my.package.MySerDe' stored as
sequencefile location '/usr/jgrimm/testcompat' as select * from ca;

 

In my serde, I'm using the mechanism I've seen in other SerDes to get
the column names, but the column names that are coming through are just
the generic '_col1', '_col2', etc.

 

public void initialize(Configuration sysProps, Properties tblProps)

                  throws SerDeException {

...

String columnNameProperty =
tblProps.getProperty(Constants.LIST_COLUMNS);

LOG.info("columns " + columnNameProperty);

columnNames = Arrays.asList(columnNameProperty.split(","));

...

}

 

Any help would be appreciated.

 

Thanks,

Jon