Skip to content
Advertisement

Tag: hadoop

Convert from lateral view to case statements in hive

I need to place below code in case statement: I have tried: But getting error. Answer For the provided SQL on table tab1, the actual logic is like: Explode field secondary.tertiary, alias it as lv, which results in a temporary result set (table) tab2; A join-like operation to concatenate tab2’s fields back to rows in tab1, resulting in another intermediate

Array operation on hive collect_set

I am working on hive on large dataset, I have table with colum array and the content of the colum is as follows. [“20190302Prod4” “20190303Prod1” “20190303Prod4” “20190304Prod4” “20190305Prod3” “…

“Hive” max column value from multiple columns

Hi: I have a situation where I need to find the max value on 3 calculated fields and store it in another field, is it possible to do it in one SQL query? Below is the example One way I tried is to calculate Personal_Income, Share_Income, Job_Income in the first pass and in the second pass I used but this

How to find previous date in HIVE

I want to find previous date in Hive. For example : I have Date as 20180821 (yyyyMMdd) format, I want to find previous date of this in Hive. I tried date_sub() function, seems it works only with yyyy-MM-dd format. How to solve my issue. Please help Answer In addition to already provided solution with unix_timestamp conversion, please consider also this.

How to prevent sql without limit in Hive?

Many users are used to using ‘select * from tables’ in oracle/mysql But i should not allow them to query like that in hive Is there any way to prevent a full_table scan in hive? Like trigger or somethng else? Thanks a lot! Answer To prevent full table scan use these settings. Hive will generate exception if partition predicate is

Advertisement