Questions tagged [hiveddl]

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

Official documentation: LanguageManual DDL

117 questions
2
votes
1 answer

How do we drop partitions in hive with regex. Is it possible?

I am trying to run the following alter table historical_data drop partition (my_date not rlike '[A-Za-z]'); Which gives me an Exception org.apache.hadoop.hive.ql.parse.ParseException: line 2:69 mismatched input 'not' expecting set null in drop…
Akshay Hazari
  • 3,186
  • 4
  • 48
  • 84
2
votes
1 answer

How do I make it such that the result of a query is partitioned as the input?

I'm a newbie on hive, so a basic question: How do I create a query such that the result of that query is partitioned in a specific way? For example: CREATE TABLE IF NOT EXISTS tbl_x ( x SMALLINT, y FLOAT) PARTITIONED BY (id SMALLINT) ROW FORMAT…
Leo Barlach
  • 480
  • 3
  • 13
2
votes
2 answers

csv file to hive table using load data - How to format the date in csv to accept by hive table

I am using load data syntax to load a csv file to a table.The file is same format as hive accepts. But still after load data is issued, Last 2 columns returns null on…
sjd
  • 1,329
  • 4
  • 28
  • 48
2
votes
2 answers

Error : ParseException line 2:0 missing EOF at 'LIKE' near ')'

I would like to create externel table using like option. CREATE EXTERNAL TABLE IF NOT EXISTS test1 (rec string) LIKE 'EPCTR_201804' LOCATION '/hdfs/t1/tt1/PR/34/1xx/E1ERPSE/201801/PR/20180202-000758/*'; But this error was shown saying : …
SA2018
  • 367
  • 4
  • 16
2
votes
1 answer

How do I partition a table by all values?

I have an external table, now I want to add partitions to it. I have 224 unique city id's and I want to just write alter table my_table add partition (cityid) location /path; but hive complains, saying that I don't provide anything for the city id…
pavel_orekhov
  • 1,657
  • 2
  • 15
  • 37
2
votes
1 answer

How to remove Hive table bucketing

I mistakenly executed the following ALTER statement with table stocks: ALTER TABLE stocks CLUSTERED BY (exchange, symbol) INTO 48 BUCKETS; How to undo this command?
Iskuskov Alexander
  • 4,077
  • 3
  • 23
  • 38
2
votes
1 answer

Hive views not reflecting base table changes

I have a number Views in Hive. Most of the views were created using a pattern select * rather than specific column names. When a column was removed from the base table, all these views started throwing missing column errors. I couldn't even do a…
Bala
  • 11,068
  • 19
  • 67
  • 120
2
votes
1 answer

Is it possible to add a bloom filter on an existing table with data?

I have a table stored in ORC format with a bloom filter defined for 1 column. Is it possible to add a filter for another column (without reinserting the data) after the table is created and populated with data ?
Eugen
  • 2,292
  • 3
  • 29
  • 43
2
votes
2 answers

Apache Hive: How to Add Column at Specific Location in Table

I want to add a new column to a specific location in hive table. when i add new column it goes to the last position.
user2102237
2
votes
2 answers

How do we get the 1000 tables description using hive?

I have 1000 tables, need to check the describe ; for one by one. Instead of running one by one, can you please give me one command to fetch "N" number of tables in a single shot.
2
votes
2 answers

hive add partition statement ignores leading zero

I've folder on hdfs /user/test/year=2016/month=04/dt=25/000000_0 Need to add this above partition path to a test table. command : ALTER TABLE test ADD IF NOT EXISTS PARTITION (year=2016,month=04,dt=25) But this add partition command is ignoring the…
pramav
  • 473
  • 3
  • 11
  • 20
1
vote
1 answer

Creating Hive View - Turn off metadata lookup from Hive Metastore

Is it possible to create a hive view on top of a nonexistent hive table or views?. This ability will help us deploy the hive DDL without any order at the time of refresh (migrating tables or views from one environment to another). In our…
1
vote
1 answer

Any production scenario where External table in Hive is definitely needed?

I know when we try to delete the table, it only deletes meta data but not data. But what could be the particular production use case in industry where internal tables may not be useful and it can only be achieved through external tables? If we…
1
vote
1 answer

Do I need to do msck repair table after alter table?

I have a partitioned by column 'date' table to which I added a column like so: ALTER TABLE table_name ADD COLUMNS (message_id_external string) CASCADE; Do I need to do msck repair table after this and analyze table table_name partition(date)…
pavel_orekhov
  • 1,657
  • 2
  • 15
  • 37
1
vote
2 answers

INSERT OVERWRITE on just created table

I have to replicate a process for a client. I have never worked with Hive, so I am trying to understand what they were doing in other cases. The Hive script I am trying to understand is this one: DROP TABLE IF EXISTS…
Luiscri
  • 913
  • 1
  • 13
  • 40