Skip to content

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…

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 …

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 …