Questions tagged [hiveql]

Variant of SQL used in the Apache Hive data warehouse infrastructure. Use this tag for questions related to the Hive Query Language including HiveQL syntax and HiveQL-specific functions.

HiveQL is the dialect of used in Apache Hive. HiveQL is similar to other dialects of SQL, but has some limitations (e.g. absence of nested subqueries and top-level disjuncts) and additional features (e.g. MapJoin), compared to most other dialects. Apache Hive is a infrastructure package built on the distributed-computing framework, written in Java.

Please read How to write good SQL question section in SQL tag wiki and follow the same rules.

References

4862 questions
1
vote
1 answer

Getting "Results have expired, rerun the query if needed." error message when running code in Hive

I'm encountering the following error message when I attempt to run SQL code in the Hive editor in Hue: Results have expired, rerun the query if needed. So far neither I nor IT can figure out the problem. Several coworkers have faced similar…
RobertF
  • 824
  • 2
  • 14
  • 40
1
vote
1 answer

Populate the columns of a Hive SQL query with results of another query

Apache Hive (version 1.2.1000.2.6.5.0-292) I have a table, A, that has a large number of columns. I'm trying to select only the columns that I need from A and the columns I want live in a key-value pair table, B. (Example below). I can query B to…
Micah Pearce
  • 1,805
  • 3
  • 28
  • 61
1
vote
1 answer

to make a global means in a request

my table SALES ID | NAMEPRODUCT | CATEGORY | AMOUNT 1 | COMPUTER | IT | 600 2 | T-SHIRT | CLOTHING | 25 3 | Doll | TOY | 10 4 | KEYBORD | IT | 30 5 | CAP | CLOTHING | 10 …
broly21
  • 93
  • 7
1
vote
1 answer

How to perform difference on partitioned column over order by clause?

Consider a table like the following: col1 col2 col3 1000 RRR 100000 2000 RRR 400000 3000 RRR 300000 4000 YYY 200000 5000 YYY 400000 6000 RRR 400000 6000 ZZZ 500000 The output I want: 1000 RRR 0 2000 RRR 300000 3000 RRR …
1
vote
1 answer

How to convert SQL Query to HiveSQL and get Min Date?

How to convert SQL Query to HiveSQL and get Min Date instead of using datepart as following: %sql -- To clear table if it already exists DROP TABLE IF EXISTS bar; -- Create temp table syntax CREATE TEMP VIEW bar AS --// Start date…
zorost
  • 11
  • 3
1
vote
1 answer

Reducer Selection in Hive

I have following record set to process like 1000, 1001, 1002 to 1999, 2000, 2001, 2002 to 2999, 3000, 3001, 3002 to 3999 And I want to process the following record set using HIVE in such a way so that reducer-1 will process data 1000 to 1999…
Suvo
  • 19
  • 1
1
vote
1 answer

Concatenate 3 text variables from the same row

I have 3 variables that they are text. It can be a sentence, not just a word. Example: Variable1: Hey, how are you?. Variable1: I am fine. Variable1: You are nice I am running this: LOWER(CONCAT(COALESCE(title," "), COALESCE(hotel_positive,"…
Robbie
  • 121
  • 11
1
vote
2 answers

Count Frequency of words of a Text variable with Hive

I have a variable that every row is a sentence. Example: -Row1 "Hey, how are you? -Rwo2 "Hey, Who is there? I want that the output is the count group by word. Example: Hey 2 How 1 are 1 ... I am using split a bit funtion but I am a bit stuck.…
Robbie
  • 121
  • 11
1
vote
2 answers

Add missing monthly rows

I would like to list the missing date between two dates in a request for example My data : YEAR_MONTH | AMOUNT 202001 | 500 202001 | 600 201912 | 100 201910 | 200 201910 | 100 201909 | 400 201601 | 5000 I want the…
broly21
  • 93
  • 7
1
vote
1 answer

How to convert UTC to CST timestamp by retaining the milliseconds in data in Hive

I have a hive table in which the data with datatype timestamp is in UTC format. I have created a view on top of this table to convert UTC to CST with daylight savings. That conversion is working fine. But the data is missing milliseconds in it. The…
Amrutha K
  • 204
  • 1
  • 3
  • 13
1
vote
1 answer

ADD date missing in request

I would like to list the missing date between two dates in a request for example my data : TABLE ORDER DATE_order | AMOUNT 01/01/2020 | 500 01/01/2020 | 600 03/01/2020 | 100 05/01/2020 | 300 I want the request to…
broly21
  • 93
  • 7
1
vote
1 answer

Hive : inner join to update "table a" from "table b" where values in "table b" is different from "table a" ? create a last view (a+b)

I have two tables (table a and table b) in Hive. The table a is an init table (full). The table b is a delta table with the latest updates (this table has the same columns and 5 more columns including a timestamp column for the last updates). I want…
1
vote
1 answer

Hive count distinct UDAF

I ran into a Hive query calculating a count distinct without grouping, which runs very slow. So I was wondering how is this functionality implemented in Hive, is there a UDAFCountDistinct for this?
user12645833
1
vote
1 answer

How to use the recursive query in Hive

It has blank data. ID Page Timestamp Sequence Orestes Login 152356 1 Orestes Account view 152368 Orestes Transfer 152380 Orestes Account view 162382 2 Orestes Loan …
orestes
  • 25
  • 4
1
vote
1 answer

In Hive, how to sort log order by time session and page in data

In Hive, pages that are repeated in the log data, want to separate and order sessions with only the time remaining when they first ID Page Timestamp Orestes Login 152356 Orestes Login 152360 Orestes …
orestes
  • 25
  • 4