2
hdfs
にあるjsonファイルからハイブテーブル( "desiredtable")を作成しようとしています。
以下は私が従った手順です:ネストされていないjsonデータファイルからハイブテーブルを作成するとnullとして出力されます
最初に私はhive-serdes-1.0-SNAPSHOT.jar
をhive/lib
フォルダにコピーしました。
1. add jar /usr/local/hive/lib/hive-serdes-1.0-SNAPSHOT.jar;
2. create external table sample_data (reviewerID string , reviewText string)
row format serde 'com.cloudera.hive.serde.JsonSerDe'
location '/dataset';
3. create table desiredtable as select * from sample_data;
4. select * from desiredtable ;
しかし、4番目のステップを実行すると、下の[image] [1]に示すようにnull値が返されます。親切に私が犯した間違いが何であるかに導く
{
"reviewerID": "A00000262KYZUE4J55XGL",
"asin": "B003UYU16G",
"reviewerName": "Steven N Elich",
"helpful": [0, 0],
"reviewText": "It is and does exactly what the description said it would be and would do. Couldn't be happier with it.",
"overall": 5.0,
"summary": "Does what it's supposed to do",
"unixReviewTime": 1353456000,
"reviewTime": "11 21, 2012"
}
{
"reviewerID": "A000008615DZQRRI946FO",
"asin": "B005FYPK9C",
"reviewerName": "mj waldon",
"helpful": [0, 0],
"reviewText": "I was sketchy at first about these but once you wear them for a couple hours they break in they fit good on my board an have little wear from skating in them. They are a little heavy but won't get eaten up as bad by your grip tape like poser dc shoes.",
"overall": 5.0,
"summary": "great buy",
"unixReviewTime": 1357603200,
"reviewTime": "01 8, 2013"
}
:
JSONデータは、下記のフォームのでしょうか?