2013-11-27-hadoop-tutorial-create-hive-tables-with-headers-and.md 2.2 KB


title: Create Hive tables with headers and load quoted CSV data author: admin type: post date: 2013-11-27T18:54:00+00:00 url: /hadoop-tutorial-create-hive-tables-with-headers-and/ tumblr_gethue_permalink:

  • http://gethue.tumblr.com/post/68282571607/hadoop-tutorial-create-hive-tables-with-headers-and tumblr_gethue_id:
  • 68282571607 sf_thumbnail_type:
  • none sf_thumbnail_link_type:
  • link_to_post sf_detail_type:
  • none sf_page_title:
  • 1 sf_page_title_style:
  • standard sf_no_breadcrumbs:
  • 1 sf_page_title_bg:
  • none sf_page_title_text_style:
  • light sf_background_image_size:
  • cover sf_social_sharing:
  • 1 sf_sidebar_config:
  • left-sidebar sf_left_sidebar:
  • Sidebar-2 sf_right_sidebar:
  • Sidebar-1 sf_caption_position:
  • caption-right slide_template:
  • default categories:
  • Browsing
  • Querying ---

Hue makes it easy to create Hive tables.

With HUE-1746, Hue guesses the columns names and types (int, string, float…) directly by looking at your data. If your data starts with a header, this one will automatically be used and skipped while creating the table.

{{< youtube RxT0M8JgvOk >}}

Quoted CSV fields are also compatible thanks to HUE-1747.

Here is the data file used:

http://www.fdic.gov/bank/individual/failed/banklist.html

 

This is the SerDe for reading quoted CSV:

https://github.com/ogrodnek/csv-serde

 

And the command to switch the SerDe used by the table:

ALTER TABLE banks SET SERDE 'com.bizo.hive.serde.csv.CSVSerde'

Now go analyze the data with the Hive, Impala or Pig editors!