Let’s say we have a table name employee_multiple_depts and each employee in the table is mapped to 3 departments – dept1, dept2 and dept3. select * […]
Let’s say you have a Hive table and the Hive table is pointing at a location or directory which has several sub directories and each subdirectories […]
How to parse information from URL in Hive? Hive offers 2 functions to work with URLS – parse_url and parse_url_tuple. With both functions you can extract […]
Let’s consider the below table employee_depts with 2 columns – ename and dept_list. dept_list is of type array and has the list of departments. CREATE TABLE […]
The difference between static and dynamic partitioning only exists when the partition is being created based on how the partitions are added to the table. Once […]
Hive by default store all the files behind the Hive table under the warehouse directory. But this location can be overridden during table or later when […]
In this post we will explain the architecture of Hive along with the various components involved and their functions. HiveServer2 HiveServer2 is an improved implementation of […]
LATERAL VIEW and EXPLODE are 2 different things in Hive. Lateral view is used in conjunction with user-defined table generating functions such as explode(). Problem Let’s […]
Comparing 2 dates is quite common when you deal with data. Hive has datediff function to help you compare 2 dates. Solution datediff function in Hive […]
Simple problem with a simple solution. Solution Order the records first and then apply the LIMIT clause to limit the number of records. SELECT * FROM […]
Simple problem with a simple solution. Solution Use the powerful regexp_replace function to replace characters. regexp_replace(string INITIAL_STRING, string PATTERN, string REPLACEMENT): Replace tab in the string […]
Pretty simple problem with a simple solution. Solution CURRENT_DATE will give the current date and CURRENT_TIMESTAMP will give you the date and time. 0: jdbc:hive2://ms2.hirw.com:2181,wk1.hirw.co> SELECT […]