美文网首页
hive内部表和外部表

hive内部表和外部表

作者: 正居明阳 | 来源:发表于2018-06-23 22:35 被阅读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'

相关文章

网友评论

      本文标题:hive内部表和外部表

      本文链接:https://www.haomeiwen.com/subject/irfwsftx.html