You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org
Analytics/Systems/Cluster/Hive
File:Pageview @ Wikimedia (WMF Analytics lightning talk, June 2015).pdf
Apache Hive is an abstraction built on top of MapReduce that allows SQL to be used on various file formats stored in HDFS. WMF's first use case was to enable querying of unsampled webrequest logs.
Access
In order to get shell access to the Analytics Cluster through Hive you need to be added to either the analytics-privatedata-users
or the analytics-users
shell user group. Per Requesting shell access, create a Phabricator ticket for such request. Some analytics team generated data (like the webrequest logs) are considered private data, and only analytics-privatedata-users
can access it. If you are getting access to Hive, you will probably want to be in this group.
For how to access the servers (once you have the credentials), see: Analytics/Cluster/Access
Querying
- Analytics/Cluster/Hive/Queries (includes a FAQ about common tasks and problems)
- Analytics/Cluster/Hive/QueryUsingUDF
While hive supports SQL, there are some differences: see the Hive Language Manual for more info.
Maintained tables
(see also Analytics/Data)
- Webrequest (raw and refined)
- pageview_hourly
- projectview_hourly
- pagecounts_all_sites
- mediacounts
- mobile_apps_session_metrics
- EventLogging data, in the
event
database (details)
Notes
- The wmf_raw and wmf databases contain Hive tables maintained by Ops. You can create your own tables in Hive, but please be sure to create them in a different database, preferably one named after your shell username.
- Hive has the ability to map tables on top of almost any data structure. Since webrequest logs are JSON, the Hive tables must be told to use a JSON SerDe to be able to serialize/deserialize to/from JSON. We use the JsonSerDe included with Hive-HCatalog.
- The HCatalog .jar will be automatically added to a Hive client's auxpath. You shouldn't need to think about it.
Troubleshooting
See the FAQ
Subpages of Analytics/Systems/Cluster/Hive
See also
- Analytics/Cluster/Access - on how to access Hive and Hue (Hadoop User Experience, a GUI for Hive)