Skip to content
Advertisement

Tag: hive

How to combine two tables to get singel table in Hive

I have following tables and need to combine them in hive Could any one please help me how can we achieve this. I tried date part with coalesce and it is fine. But fam part is not able to merge into single column. Really appreciate your help. Thanks, Babu Answer You can use full outer join. However, union with left

how to merge multiple rows into single in MSSQL

this is my data: id segment country product status month year 83916512 Government Null Null Null Null 2014 83916512 Null Germany Null Null Null 2014 83916512 Null Null Carretera Null Null 2014 83916512 Null Null Null completed Null 2014 83916512 Null Null Null Null June 2014 83916512 Null Null Null Null Null 2014 i want below output can anybody help

Getting NULL after combining strings between date functions

Given a date column with a value 2020-05-01, I want to return 2020-Q2. The QUARTER() function is not available due to the Hive version we are using. I can get the quarter number with: (INT((MONTH(yyyy_mm_dd)-1)/3)+1). When I try to combine this with the YEAR() function and strings, I get null: How can I properly concatenate this to get the desired

Convert Postgre query to Hive/ Mysql

I have this table: I want to a situation where each footballer appears only once in a new table. For instance, Messi appears twice, but I want to take any occurrence of Messi in the new table. I am not sure how to convert it to either Hive or mysql. This is what I want the desired results to look

Cross Join in Hive

I’m trying to create a new column time_period while running the query below. If the date difference between a given transaction and the most recent transaction in the reference table is fewer than 7 days, then mark it as a recent transaction, else mark it as an old transaction. However, the query below is generating an error in the subquery

Advertisement