Hive Use case example for JSON Data 2
Hive Use case example with US government web sites data Click here to download example data to analyze —> UsaGovData The data present in the above file is JSON Format and its JSON Schema is as shown below,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
{ "a": USER_AGENT, "c": COUNTRY_CODE, # 2-character iso code "nk": KNOWN_USER, # 1 or 0. 0=this is the first time we've seen this browser "g": GLOBAL_BITLY_HASH, "h": ENCODING_USER_BITLY_HASH, "l": ENCODING_USER_LOGIN, "hh": SHORT_URL_CNAME, "r": REFERRING_URL, "u": LONG_URL, "t": TIMESTAMP, "gr": GEO_REGION, "ll": [LATITUDE, LONGITUDE], "cy": GEO_CITY_NAME, "tz": TIMEZONE # in http://en.wikipedia.org/wiki/Zoneinfo format "hc": TIMESTAMP OF TIME HASH WAS CREATED, "al": ACCEPT_LANGUAGE http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 } |
Note: If you copy the text file into LFS make sure that you do not have any empty lines at the end of the file otherwise you will encounter below exception
1 2 |
<span class="pln">java</span><span class="pun">.</span><span class="pln">io</span><span class="pun">.</span><span class="typ">EOFException</span><span class="pun">:</span> <span class="typ">No</span><span class="pln"> content to map to </span><span class="typ">Object</span><span class="pln"> due to end of input</span> |
[…]