匯出結果

用 INSERT OVERWRITE DIRECTORY {sql 語法} 好處是 不用再額外 create 一張 hive table ,也省掉了 定義 schema ,但壞處是result 有格式的問題。

在beeline :

INSERT OVERWRITE DIRECTORY '/user/<user_name>/hive_result' SELECT * FROM master;

在Linux

$ hadoop fs -get /user/<user_name>/hive_result ./hive_result1
$ head hive_result1/000000_0

results matching ""

    No results matching ""