Questions tagged [hive-query]

82 questions
0
votes
1 answer

Calculate the sum of a column on weekly basis in hive

I have a table say testTable in Hive(with data for 3 years) with the following columns: retailers, order_total, order_total_qty, order_date I have to create a new table with these columns: 'source_name' as source, sum(retailers),…
Learner
  • 51
  • 1
  • 1
  • 7
0
votes
1 answer

Insert data into Hive table using lookup table

Could someone help me in this scenario? How to insert data into a Hive table by looking up values from other Hive table? My input_source table is like below: date key lines type 29-May 1 A A16 29-May 2 B D44 29-May 3 C …
scalauser
  • 1,327
  • 1
  • 12
  • 34
0
votes
1 answer

Separating a column data into multiple columns in hive

I have a sample data for a device which contains two controller and it's version. The sample data is as follows: device_id controller_id versions 123 1 0.1 123 2 0.15 456 2 0.25 143 …
Sara
  • 312
  • 6
  • 15
0
votes
1 answer

Accessing the column names from the string containing a JSON in java

I have a string in java String val = "{"column":[{"name":"id,"type":"int"},{"name":"empname","type":"string"}], "database":"test","table":"sample"}" How do I retrieve only the column name My result must be a string containing the column names…
Nightwing
  • 37
  • 6
0
votes
1 answer

Hive Error: compiling statement: FAILED: ParseException line 15:0 missing EOF at 'collection' near ''\n''

I'm new to hive and I'm creating a table with the following properties, CREATE EXTERNAL TABLE EXTTBL_Transactions ( TRANSACTION_ID varchar(70) COMMENT 'UniqueID, `Primary Key', DEFINITION_ID varchar(70) COMMENT 'Definition, Null Allowed', …
Ganesh
  • 61
  • 10
0
votes
1 answer

how to add partition to hive table with nested data?

I am loading my logs from S3 into Hive with CREATE TABLE logs( `col1` struct<`country`:string,`page`:string,`date`:string> ) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' LOCATION 's3a://application-logs/sample/' ; My data looks like…
midNight
  • 155
  • 1
  • 4
  • 18
-1
votes
2 answers

How to fix 'org.apache.hadoop.hive.ql.metadata.HiveException' in Hive-Spark, when using simple query?

I am trying to perform a simple query on Hive - Spark engine: SELECT count(*) FROM classification_output GROUP BY model_id; I keep receiving the below error: Error: Error while compiling statement: FAILED: SemanticException Failed to get a spark…
MMSA
  • 810
  • 8
  • 22
1 2 3 4 5
6