hive内部表和外部表

2018-06-23  本文已影响0人  正居明阳

内部表就是hive默认的目录

外部表,在创建的时候,可以指定一个location
这样在上传数据的时候,会传到这个指定的location
类似:
load data local inpath '/Users/FengZhen/Desktop/Hadoop/hive/testfile/fz_external_table.txt' into table fz_external_table;

另外,外部表,也可以为某个分区直接指定一个hdfs路径,和创建表的时候指定的路径不一样的,都是可以的
alter table xxx add if not exists partition (partition_field=xxx) location 'some hdfs path'

上一篇 下一篇

猜你喜欢

热点阅读