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 load multiple partitioned HDFS file to table

I have some twice-partitioned files in HDFS with the following…
hunterm
  • 247
  • 5
  • 11
1
vote
1 answer

Hive Update partition vs MSCK Repair

I have a table with thousands of partition. I want to change all the partition location to diff cluster. Ex: for table test_table and partition day=2021041600 Old location: hdfs://cluster1/dir1/dir2/day=2021041600/\ New location:…
Sumit Singh
  • 15,743
  • 6
  • 59
  • 89
1
vote
1 answer

How partitioning and clustered by works in Hive table?

I'm trying to understand below query by using that how data is going to be placed. CREATE TABLE mytable ( name string, city string, employee_id int ) PARTITIONED BY (year STRING, month STRING, day STRING) CLUSTERED BY…
nut
  • 51
  • 7
1
vote
1 answer

How can I create Hive tables from AWS S3 bucket from my local machine?

I am trying to create hive table from S3 location but I am getting error. This is my query hive> create external table if not exists external_sales(invoice_id string, branch string, customer_type string, gender string, product_category string, price…
ssk
  • 55
  • 4
1
vote
1 answer

Hive External Table Returning zero Rows

I have a snappy compressed parquet file in local directory /home/hive/part-00000-52d40ae4-92cd-414c-b4f7-bfa795ee65c8-c000.snappy.parque. When an external hive table is created with the below command it gets executed but when select * from…
1
vote
1 answer

Hive external table read json as textfile

I'm trying to create a hive external table for a json file in .txt format. I have tried several approaches but I think I'm going wrong in how the hive external table should be defined: My Sample JSON is: [[ { "user": "ron", "id": "17110", …
user2441441
  • 1,237
  • 4
  • 24
  • 45
1
vote
1 answer

Create a table in hive with timestamp as comment

I would like to create a table in hive, inside the comment include the creation date (current_timestamp function). Something like this: CREATE TABLE IF NOT EXISTS ex.tb_test ( field1 int, field2 String) COMMENT current_timestamp STORED AS…
1
vote
1 answer

What happens if I move Hive table data files before moving the table?

I am trying to move the location of a table to a new directory. Let's say the original location is /data/dir. For example, I am trying something like this: hadoop fs -mkdir /data/dir_bkp hadoop fs -mv /data/dir/* /data/dir_bkp I then do hive…
formicaman
  • 1,317
  • 3
  • 16
  • 32
1
vote
1 answer

How to handle delimiter in column value?

I am trying to load CSV file data into my Hive table,but but it has delimiter(,) , in one column's value, so Hive is taking it as a delimiter and loading it into a new column. I tried using escape sequence \ but in that I also \ (it its not…
Rahul Patidar
  • 189
  • 1
  • 1
  • 14
1
vote
1 answer

importing data into hive table from external s3 bucket url link

I need to import data from a public s3 bucket which url is shared with me. how to load the data into hive table? I have tried below command but its not working: create external table airlines_info (.... ) row format delimited fields terminated by…
1
vote
1 answer

Failed make hive table on desired path and insert the values

I want to make table in hive containing of only 1 column and 2 values: 'Y' and 'N' I already try this: create external table if not exists tx_test_table (FLAG string) row format delimited fields terminated by ',' stored as textfile location…
1
vote
2 answers

Error while trying to create external table in hive

I am trying to create an external table using hive with hadoop but somehow it failed. These are the error I get when I try to run my queries. 02:23:29.516 [HiveServer2-Background-Pool: Thread-39] ERROR hive.ql.exec.DDLTask -…
Lyn
  • 23
  • 3
1
vote
1 answer

Hive External Table - Drop Partition

Facing a weird issue. Alter table command to drop partition works well for > or < or >= or <= signs but not for = check. Working command: ALTER TABLE XYZ DROP PARTITION(bizdate>'20231230'); Command that's not working and throwing an error stating…
Dasarathy D R
  • 335
  • 2
  • 7
  • 20
1
vote
1 answer

RegEx to create AWS Athena Table (RegexSerDe)

I am trying to create AWS Athena table based on the logs stored in S3. I intend to use RegEx to create the table but I could not find RegEx which will work for me CREATE EXTERNAL TABLE `dev_logs`( `date_time` string COMMENT '', `type` string…
Moin
  • 166
  • 8
1
vote
1 answer

Cloudera - Hive/Impala Show Create Table - Error with the syntax

I'm making some automatic processes to create tables on Cloudera Hive. For that I am using the show create table statement that me give (for example) the following ddl: CREATE TABLE clsd_core.factual_player ( player_name STRING, number_goals…
Pedro Alves
  • 1,004
  • 1
  • 21
  • 47