2016-07-05 4 views
1

'/ home/hadoop/_user_active_score_small'というファイルが存在します。しかしSemanticException取得するには、以下のようにload data localを実行すると:ハイブをロードするときファイル名のため無効なパスローカルのパスin

hive> load data local inpath '/home/hadoop/_user_active_score_small' overwrite into table user_active_score_tmp ; 
FAILED: SemanticException Line 1:24 Invalid path ''/home/hadoop/_user_active_score_small'': No files matching path file:/home/hadoop/_user_active_score_small 

しかし、cp /home/hadoop/_user_active_score_small /home/hadoop/user_active_score_smallをし、再度load dataを実行します。

hive> load data local inpath '/home/hadoop/user_active_score_small' overwrite into table user_active_score_tmp ; 
Loading data to table user_bg_action.user_active_score_tmp 
OK 
Time taken: 0.368 seconds 

ファイルのアクセスタイプは、同じディレクトリに、同じです。

-rw-rw-r-- 1 hadoop hadoop 614 7月 5 13:49 _user_active_score_small 
-rw-rw-r-- 1 hadoop hadoop 614 7月 5 11:48 user_active_score_small 

これはどうなるのでしょうか。ハイブが '_'で始まるファイル名は許可されていませんか?

答えて

1

アンダースコアが_で始まるファイルとディレクトリは、MapReduceで非表示と見なされます。これは、おそらく観察された動作の原因です。あなたはFileInputFormatソースコードを見れば

あなたはこれを見つけることができます:

protected static final PathFilter hiddenFileFilter = new PathFilter(){ 
    public boolean accept(Path p){ 
    String name = p.getName(); 
    return !name.startsWith("_") && !name.startsWith("."); 
    } 
}; 
関連する問題