我的产品中有一个配置单元外部表(比如表1)。当我这么做的时候 desc formatted table1
我能看到一些地方。当我这么做的时候 desc formatted table1 partition(date = 22042019)
相反,它得到了不同的hdfs位置。
例如:
desc formatted table1
Location: user/hive/warehouse/db.db/loc1
Desc formatted table1 partition (date = 22042019")
Location: x/y/loc/date=22042019
1条答案
按热度按时间olqngx591#
表和分区的位置可以不同。在插入期间添加分区而不指定位置或动态创建分区时,分区文件夹通常在表位置内创建。但你可以用
alter table add partition ...location
... 或者[alter table partition set location][1]
在这种情况下,可以在表位置之外创建分区。你也可以alter table set location
设置不同的位置。在本例中,所有现有分区及其位置都将保持原样并可访问,尽管它们的基位置和表位置不同。