Hive SerDe for CSV
Go to file
Larry Ogrodnek 9a10d8f253 update readme 2013-10-30 12:05:23 -07:00
src convert to maven 2013-10-30 11:43:43 -07:00
.classpath support for hive 0.8.1 2013-02-12 13:06:34 -08:00
.gitignore allow custom separator, escape, quote chars 2011-12-16 13:35:38 -08:00
.project fix eclipse project name 2011-06-17 10:53:06 -07:00
LICENSE.txt apache 2 license 2011-11-16 11:59:46 -08:00
pom.xml convert to maven 2013-10-30 11:43:43 -07:00
readme.md update readme 2013-10-30 12:05:23 -07:00

readme.md

Hive CSV Support

Build Status

This SerDe adds real CSV input and ouput support to hive using the excellent opencsv library.

Using

Basic Use

add jar path/to/csv-serde.jar;

create table my_table(a string, b string, ...)
  row format serde 'com.bizo.hive.serde.csv.CSVSerde'
  stored as textfile
;

Custom formatting

You can also specify custom separator, quote, or escape characters.

add jar path/to/csv-serde.jar;

create table my_table(a string, b string, ...)
 row format serde 'com.bizo.hive.serde.csv.CSVSerde'
 with serdeproperties (
   "separatorChar" = "\t",
   "quoteChar"     = "'",
   "escapeChar"    = "\\"
  )	  
 stored as textfile
;

Files

The following include opencsv along with the serde, so only the single jar is needed. Different builds are needed depending on your version of Hive.

Hive 0.8.*

Building

Run mvn package to build. Both a basic artifact as well as a "fat jar" (with opencsv) are produced.

License

csv-serde is open source and licensed under the Apache 2 License.