load data local inpath '資料在本地位置' into table table_name;
2. loadhdfs資料
3. 建表時指向資料位置location ''---增量匯入資料---在原來的資料後追加
load data inpath '資料在hdfs中的位置' into table table_name;
---全量匯入資料---會覆蓋掉原本的資料
load data inpath '資料在hdfs中的位置' overwrite into table table_name;
4. insert into table_name values()create [external] table table_name(
...)
...location '資料的位置';
5. insert into table_name select ...from...insert into table_name values(...);
插入一次資料便會建立乙個檔案
6. put資料到表目錄下insert into table_name select ... from table_name2;
將查詢到的資料插入到table_name中
7. create table ....as select ..from...hdfs dfs -put '本地資料位置' '表在hdfs中的目錄'
直接將檔案上傳到表的目錄下,表會讀取檔案中的資料(前提是符合表的規則)
8. import匯入資料create table table_name(
...)
as select
...from
...;
使用查詢到的資料建立表
9. sqoop datax資料遷移工具前提是將乙個表中的資料匯出
export table table_name to
'指定匯出路徑';
將匯出路徑下的資料匯入表
import table table_name from
'指定匯出路徑'
hive 匯入資料的方式
load data local inpath linux filepath into table tablename 應用場景 常見的情況,一般用於日誌檔案的直接匯入 load data inpath hdfs filepath into table tablename 應用場景 本地資料儲存檔案比...
hive 匯入資料的方式
load data local inpath home hadoop data test1.txt into table test1 此處的檔案是從linux中的路徑中取的檔案插入到test1表中去的 load data inpath input test1.txt into table test1...
hive匯入資料的方式
load data local inpath filepath overwrite into table tablename partition partcol1 val1,partcol2 val2 解釋 local 可選,表示從本地檔案系統中載入,而非hdfs overwrite 可選,先刪除原...