Skip to content Skip to sidebar Skip to footer
Showing posts with the label Hive

In Hive, How To Read Through Null / Empty Tags Present Within An Xml Using Explode(xpath(..)) Function?

In below Hive-query, I need to read the null / empty 'string' tags as well, from the XML co… Read more In Hive, How To Read Through Null / Empty Tags Present Within An Xml Using Explode(xpath(..)) Function?

Transpose Dataset In Hive

I'm trying to transpose a variable in Hive such as: Id1 Id2 Event 1 1 7 2 2 3 2 … Read more Transpose Dataset In Hive

Sql: Explode An Array

I have a table that contains JSON objects. Each JSON object contains an array in square brackets, s… Read more Sql: Explode An Array

Hive Sort Array Column With Respect To Other Array Column In Same Table

I have a table in hive , with 2 columns as col1 array and col2 array . Output is as shown below co… Read more Hive Sort Array Column With Respect To Other Array Column In Same Table

Temporal Join In Hive Query (events In Close Proximity In Time)

I have a need for a hive query that I'm having difficulty figuring out. I have a time series th… Read more Temporal Join In Hive Query (events In Close Proximity In Time)

Hive Sql Query To Fill Missing Date Values In Table With Nearest Values

I have spent days trying to figure out how to add missing dates with the nearest values in Hive wit… Read more Hive Sql Query To Fill Missing Date Values In Table With Nearest Values

Inserting Into Table A Number Of Rows That Equal The Number Of Open Rows If There Are More Than 15 Of Them

My table id sum type 1 3 -1 1 6 -1 1 -6 2 1 -3 … Read more Inserting Into Table A Number Of Rows That Equal The Number Of Open Rows If There Are More Than 15 Of Them

Sort Within Category And Limit 5 For This Hive Table

I have a hive table A that has the following column USER ITEM SCORE U1 I1 S1 U1 … Read more Sort Within Category And Limit 5 For This Hive Table

Query To Divide Data

we have two columns id and monthid. The output what I'm looking for is to divide year from mont… Read more Query To Divide Data

Into Hive Table - Non Partitioned Table To Partitioned Table Having Multiple Partitions - Cannot Insert Into Target Table Because Column Number/types

When I tried to insert into a Partiotioned table I am getting the bellow error: SemanticException [… Read more Into Hive Table - Non Partitioned Table To Partitioned Table Having Multiple Partitions - Cannot Insert Into Target Table Because Column Number/types

Hive/sql Bundling Columns For Few Columns,rest Of The Columns Are Pull Based Lowest/highest Of Other Columns

i have a hive table as below with 5 columns name orderno productcategory amount description KJFSFKS… Read more Hive/sql Bundling Columns For Few Columns,rest Of The Columns Are Pull Based Lowest/highest Of Other Columns

How To Calculate The Time Length Of 0-1 Sequence With Hive?

Now I have a data like: time(string) id(int) 201801051127 0 201801051130 0 201801051132 0 20180… Read more How To Calculate The Time Length Of 0-1 Sequence With Hive?

Hive - How To Efficiently Create Table As Select?

I have a hive table, htable that's partitioned on foo and bar. I want to create a small subset … Read more Hive - How To Efficiently Create Table As Select?

Sql Return The Record Where The Value In A Column Have Changed

I have data in Hive table which look something like this - I would like to get a summarized data w… Read more Sql Return The Record Where The Value In A Column Have Changed

Unable To Create Table In Amazon Athena

I tried creating a table in Athena for my nested json files in s3, but receiving an error: line 1:… Read more Unable To Create Table In Amazon Athena

How To View The Calculated Value Of A Hive Variable

I'm trying to see the value of a calculated value in hive. For example, I'm trying to get t… Read more How To View The Calculated Value Of A Hive Variable

Manipulating A Data Structure In Pig/hive

I'm not really sure how to phrase this question, so please redirect me if there is a better pla… Read more Manipulating A Data Structure In Pig/hive

Hive Query: Select A Column Based On The Condition Another Columns Values Match Some Specific Values, Then Create The Match Result As A New Column

I have to some query and creat columns operations in HiveQL. For example, app col1 app1 a… Read more Hive Query: Select A Column Based On The Condition Another Columns Values Match Some Specific Values, Then Create The Match Result As A New Column

Calculating Multiple Averages Across Different Parts Of The Table?

I have the following transactions table: customer_id purchase_date product category … Read more Calculating Multiple Averages Across Different Parts Of The Table?

How To Join A Table And Replace A Numeric Zip Code Value With A Text Zip Code Value

I have one table main_cohort that has two different columns which contain zip codes in 3 digit and … Read more How To Join A Table And Replace A Numeric Zip Code Value With A Text Zip Code Value