Questions tagged [hiveddl]

Use this tag for questions about Apache Hive Data Definition Language.

Official documentation: LanguageManual DDL

117 questions
1
vote
1 answer

Hive - incomplete rows in select from managed partitioned table

I need to copy data from a CSV file to a managed partitioned table in Hive. CSV file rows are: id,nome,cognome,ruolo 16,Mike,Maignan,Portiere 23,Fikayo,Tomori,Centrale 24,Simon,Kjaer,Centrale 19,Theo,Hernandez,Terzino ... ------- I…
Moreno
  • 25
  • 2
1
vote
1 answer

Hive Reading only one json row

I have a json like this [{"event": "1", "meta": {"name":"Kumar","":"28"}}, {"event": "2", "meta": {"name":"Harsh","":"27"}}] I removed the square bracket as in hive it is giving error org.apache.hadoop.hive.serde2.SerDeException:…
Kumar Harsh
  • 423
  • 5
  • 26
1
vote
1 answer

How to retain last N partitions for a hive external table?

I need to retain say last 7 partitions and data of a given hive external table. This can be either done via a shell script or a hive hql script. The table is partitioned by intgestion_date=YYYY-MM-DD what would be the best way to find the cutoff…
1
vote
2 answers

LATERAL VIEW explode funtion in hive

I am trying to export data from excel into a hive table, while doing so, i have a column 'ABC' which has values like '1,2,3'. I used the lateral view explode function but it does not does anything to my data. Following is my code snippet : CREATE…
1
vote
1 answer

Hive Table name starts with underscore select statement issue

In the process of executing my hql script, i have to store data into a temporary table before inserting to the main table. In that scenario, I have tried to create a temporary table with an underscore at the starting. Note: with quotes the table…
Rocky1989
  • 369
  • 8
  • 28
1
vote
1 answer

Hive alter table column fails when it has struct column

I've created hive external table. CREATE EXTERNAL TABLE test_db.test_table ( `testfield` string, `teststruct` struct ) ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'…
sngjuk
  • 927
  • 1
  • 10
  • 24
1
vote
1 answer

Unable to understand significance of external keyword in hive

I have a few doubts which I need to be clarified: If I create a table without the "External" keyword, but specify "location", will it be an external or internal table in the hive? If I use the "external" keyword with a table name but do not specify…
N_A
  • 81
  • 8
1
vote
1 answer

how to register an existing delta table to hive

We are using spark for reading/writing data in delta format stored in HDFS (Databricks Delta table version 0.5.0). We would like to utilize the power of Hive to interact with the delta tables. How can we register an existing data in delta format…
Gilbl
  • 117
  • 8
1
vote
1 answer

How to add multi-level partition in hive?

I have customer managed table in the hive, partition based on date and customerName. My directory structure is like below: user/hive/warehouse/test.db/customer/date1=2021-09-16/customerName=xyz when I am doing show partitions customer it is not…
vishwajeet Mane
  • 344
  • 1
  • 3
  • 13
1
vote
1 answer

How to add one extra partition to external hive table?

I have hive table like below create external table transaction( id int, name varchar(60)) month string ) PARTITIONED BY ( year string, transaction_type_code varchar(20) ) STORED AS PARQUET LOCATION 'hdfs://xyz'; I am…
1
vote
1 answer

Is there a possiblilty to match different csv files into one hive table?

I have 53 csv files, each with different column names and contents. I want to write all the data in the csv file into one big table in Hive that contains all the necessary columns. So it may happen that columns are left empty for certain files. This…
Nicko
  • 19
  • 6
1
vote
1 answer

What format applies to the Hive LazySimpleSerDe

What exactly is the format for Hive LazySimpleSerDe? A format like ParquetHiveSerDe tells me that Hive will read the HDFS files in parquet format. But what is LazySimpleSerDe? Why not call it something explicit like CommaSepHiveSerDe or…
Victor
  • 16,609
  • 71
  • 229
  • 409
1
vote
1 answer

Data Loaded wrongly into Hive Partitioned table after adding a new column using ALTER

I already have a Hive partitioned table. I needed to add a new column to the table, so i used ALTER to add the column like below. ALTER TABLE TABLE1 ADD COLUMNS(COLUMN6 STRING); I have my final table load query like this: INSERT OVERWRITE table…
jahan
  • 103
  • 4
  • 19
1
vote
1 answer

Does Hive need an explicit command to load data into the table from HDFS

What is the difference between this: CREATE TABLE dbo.table1( id INT, firstname STRING, ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS /usr/hive/sample_data.csv ; and CREATE TABLE dbo.table1( id INT, firstname STRING ) ROW FORMAT…
Victor
  • 16,609
  • 71
  • 229
  • 409
1
vote
1 answer

Multiple escape characters for hive create table

I am trying to load a csv with pipe delimiter to an hive external table. The data values contain single quote, double quotes, brackets etc.. Using Open CSV version 2.3 testfile.csv id|name|phone 1|Rahul|123 2|Kumar's|456 3|Neetu"s|789 4|Ravi…
Khilesh Chauhan
  • 739
  • 1
  • 10
  • 36