Questions tagged [hive-query]

82 questions
0
votes
1 answer

Hive nested query left join

I'am new to hive and i want to implement the following query select a.controlid, b.name as campaign, a.controlactivityid as activitysource, c.code as codemyaprc, c.label_en as label_en, …
a-herch
  • 137
  • 1
  • 4
  • 12
0
votes
1 answer

Hive Query cannot recognize input near 'select' 'max' '(' in expression specification

I have a table in hive with the below structure hive> describe stock_summary; OK …
tuk
  • 5,941
  • 14
  • 79
  • 162
0
votes
1 answer

How to insert into hive table, partitioned by date reading from temp table?

I have a Hive temp table without any partitions which has the data required. I want to select this data and insert into another table partitioned by date. I tried following techniques with no luck. Source table schema CREATE TABLE…
Saawan
  • 363
  • 6
  • 24
0
votes
1 answer

Fetching the 15th last working day date-yyyyMMdd (excluding only weekends) in Hive

I have a table with date column (date in string format yyyyMMdd). My requirement is to design a logic to fetch data from the table where "date column value equals to the date of the 15th previous working day" (excluding only Saturdays and Sundays)…
Sudhanshu
  • 1
  • 1
  • 3
0
votes
3 answers

Select count(*) from multiple tables in Hive

I have tables with the same name in 2 different schemas. What I want to do is get a count comparison in the 2 tables in the format TableName : Count1 : Count2 How can I achieve this via Hive query?
Kshitij Kohli
  • 4,055
  • 4
  • 19
  • 27
0
votes
0 answers

Hive Distinct Query taking more time

I have partitioned table, Table Structure create table tab1 ( col1 int, col2 string, ... col50 int, col51 int ) partitioned by (col50 int, col51 int) stored as orc; Currently we have ~17000 partitions and each partition will have minimum of ~50k…
Vijiy
  • 1,187
  • 6
  • 21
0
votes
0 answers

Find a month's last Sunday 'date' and 'day' using Hive HQL

I'm trying to find the last Sunday's date of a month using the HQL. I'm trying the below code: select Stud_no,doj,last_value(doj) OVER(partition by Stud_no) from(select Stud_no,doj,date_format(doj,'E') as day_name from Students where…
Sara
  • 312
  • 6
  • 15
0
votes
1 answer

Hive query executeQuery() hangs in java JDBC code

I have created a UDTF and I'm running below java hive JDBC code inside it to execute a hive query and get results. I'm able to get the connection to the hive2 server successfully but the code hangs indefinitely without any exception at…
MamtaJ
  • 1
  • 1
0
votes
1 answer

how to import-all-tables from Mysql to hive using sqoop for particular database in hive?

sqoop import-all-tables into hive with default database works fine but Sqoop import-all-tables into hive specified database is not working. As --hive-database is depreciated how to specify database name sqoop import-all-tables \ --connect…
premon
  • 159
  • 1
  • 3
  • 13
0
votes
0 answers

How to distinctly select a column while selecting other columns

I have a table that looks something like this in hive. What I want to do is run a query such that every 3 hours, I look at unique workerUUIDs and do some manipulation on them. So what I want to do is between now and 3hrs before Capture all the…
ExceptionHandler
  • 213
  • 1
  • 8
  • 24
0
votes
1 answer

How Can we load data into hive using URL

I have created a table in hive and I need to load csv data into hive table, but the data is in github (I have downloaded and tested it is working fine) I need to load data directly from URL is it possible to load data into hive from URL something…
Rahul Varma
  • 550
  • 5
  • 23
0
votes
1 answer

Remove specific column from Hive Partitioned external table

I would like to drop one of the columns from a huge hive partitioned table. Wondering how can I do this. Here is what I have tried as below. DDL : CREATE TABLE xyz.test_change (a int, b int, c int); ALTER command : ALTER TABLE xyz.test_change…
Teja
  • 13,214
  • 36
  • 93
  • 155
0
votes
0 answers

Select first row in each partition of Hive table

I'd like to get the first N records from each partition in a hive partitioned table without having to deserialize every record in the table. I've seen a number of solutions for other databases, but not one that works in Hive without running over…
Michael K
  • 2,196
  • 6
  • 34
  • 52
0
votes
1 answer

Data ingest issues hive: java.lang.OutOfMemoryError: unable to create new native thread

I'm a hive newbie and having an odyssey of problems getting a large (1TB) HDFS file into a partitioned Hive managed table. Can you please help me get around this? I feel like I have a bad config somewhere because I'm not able to complete reducer…
Zafar
  • 1,897
  • 15
  • 33
0
votes
0 answers

Hive: why CTAS can't read a file whereas select query can

I have put my file at /hadoop/yarn/local/usercache/root/test_abspath and want to read first line using my UDF. When I ran it using select test('ABCD','ABCD'); I could read the file but when I tried it using Create table as test_tb select…
TheBeginner
  • 405
  • 5
  • 23