0
votes

My hive table is partitioned with column 'job_id'. When I dump the data in the hdfs location of the table, then it is creating a partition with name 'JOB_ID' and my hive table is not recognizing it.

I have tried msck repair table command but that didn't helped either.

2
Can you clarify what you mean by "dump the data in the hdfs location"? Do you place some files in HDFS and then create external Hive table on it?serge_k
Partition folder name should be key=value, for example job_id=123456, not just job_idleftjoin
@serge_k yes there are files in hdfs location and hive table point to that location.Anshul Sharma
@leftjoin It is like job_id=927Anshul Sharma
Please add table DDL with location and the result of hadoop fs -ls <table location>leftjoin

2 Answers

0
votes

For external Hive tables you need to add new partition manually as follows:

ALTER TABLE table_name ADD PARTITION (job_id='927') location 'hdfs://some_location/job_id=927'
0
votes

I found out that the partition name should always be in lowercase letter. Here is the link: https://medium.com/a-muggles-pensieve/hive-partition-column-name-camelcase-bad-idea-bc203d6e65da