Hive data tables are divided into two types: Internal tables and external tables. An internal table refers to the table created by hive and imported into the database through loaddatainpath. This table can be understood as both data and Table Structure
Hive data tables are divided into two types: Internal tables and external tables. An internal table refers to the table created by hive and imported into the database through 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/8080 ';
The red part is very tricky. Almost all articles related to the word on the Internet are copied, pasted, and copied. No exception exists. All the articles are written as SORTED, if the hive Chinese document you are looking for is not me, I am afraid an error will be reported when creating an external table.