Skip to content

Instantly share code, notes, and snippets.

@mwinkle
Created November 14, 2014 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwinkle/088ae96295b1affaa6b7 to your computer and use it in GitHub Desktop.
Save mwinkle/088ae96295b1affaa6b7 to your computer and use it in GitHub Desktop.
Hive Table in Hbase
CREATE EXTERNAL TABLE reverse_ip_hbase (
rowkey STRING,
IpAddress string,
Continent string,
Country string,
CountryIso2 string,
CountryConfidence INT,
Region string,
State string,
StateConfidence INT,
City string,
CityConfidence INT,
Latitude DOUBLE,
Longitude DOUBLE,
RegisteringOrganizationName STRING,
CarrierId string,
CarrierName string
)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ('hbase.columns.mapping' =
':key,cf1:IpAddress,
cf1:Continent,cf1:Country,cf1:CountryIso2,cf1:CountryConfidence,
cf1:Region,cf1:State,cf1:StateConfidence,cf1:City,
cf1:CityConfidence,cf1:Latitude,cf1:Longitude,
cf1:RegisteringOrganizationName,cf1:CarrierId,cf1:CarrierName')
TBLPROPERTIES ('hbase.table.name' = 'reverse_ip');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment