Hive SQL使用和数据加载的一点总结

来源:这里教程网 时间:2026-02-27 12:50:58 作者:

hive的数据表分为两种,内部表和外部表。内部表指hive创建并通过load data inpath进数据库的表,这种表可以理解为数据和表结构都

create external table if not exists database.table1
(
column1 string comment 'comment1',
column2 string comment 'comment2'
)
row format delimited fields terminated by "\t"
stored as inputformat "com.hadoop.mapred.deprecatedlzotextinputformat" outputformat "org.apache.hadoop.hive.ql.io.hiveignorekeytextoutputformat"
location 'hdfs:///data/dw/asf/20120201';

标红部分是十分操蛋的,网上几乎所有涉及该单词的文章基本全是复制粘贴抄的,,无一例外,全部写成SORTED,如果你找的hive中文资料不是我这篇,恐怕创建外部表都会报错。

相关推荐