Skip to content

Instantly share code, notes, and snippets.

@randallwhitman
Created May 28, 2013 22:06
Show Gist options
  • Save randallwhitman/5666539 to your computer and use it in GitHub Desktop.
Save randallwhitman/5666539 to your computer and use it in GitHub Desktop.
create external table trips_by_origin_cell(leftlon double, botlat double, rightlon double, toplat double, totnum int, samedest int, pct double, destlhs double, destbot double, destrhs double, desttop double)
row format delimited fields terminated by '\t'
location '/user/rwhitman/out-trips-by-origin-cell';
create external table trip_origin_json (totnum int, samedest int, pct double, destlhs double, destbot double, destrhs double, desttop double, shape binary)
row format serde 'com.esri.hadoop.hive.serde.JsonSerde'
stored as inputformat 'com.esri.json.hadoop.UnenclosedJsonInputFormat'
outputformat 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
location '/user/rwhitman/trip-origin-json';
insert overwrite table trip_origin_json select totnum, samedest, pct, destlhs, destbot, destrhs, desttop,
ST_Polygon(leftlon,botlat, rightlon,botlat, rightlon,toplat, leftlon,toplat) from trips_by_origin_cell;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment