Home  >  Article  >  Database  >  Hive SQL使用和数据加载的一点总结

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

WBOY
WBOYOriginal
2016-06-07 17:11:201219browse

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中文资料不是我这篇,恐怕创建外部表都会报错。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn