2016-09-14 11 views
0

豚の期待出力を弾性検索インデックスに保存しようとしました。ElasesticSearchへのPig Store出力にエラーが発生しました

しかし、範囲外の文字列のインデックスを取得:-1例外

期待出力: -

(google_1473682742_265278445560,{(Thu Apr 12 17:38:47 +0000 2012,190494185374220289,190494185374220289,google اااااح الاجواء بتاعت سكس حااااارر منو الفحل اللي يبي اسوي له فولو يسوي رتويت,<a href="http://blackberry.com/twitter" rel="nofollow">Twitter for BlackBerry®</a>,[hashtags#[],user_mentions#[],urls#[]],false,,0,false,),(Thu Apr 12 17:38:47 +0000 2012,190494185382608899,190494185382608899,kpit 味も素っ気もない人間とは…。,<a href="http://tapbots.com/tweetbot" rel="nofollow">Tweetbot for iOS</a>,[hashtags#[],user_mentions#[],urls#[]],false,,0,false,)}) 

記述した出力を、 -

output: {pattern: chararray,tweets: {(lowertweets::created_at: chararray,lowertweets::id: chararray,lowertweets::id_str: chararray,lowertweets::text: chararray,lowertweets::source: chararray,lowertweets::entities: map[chararray],lowertweets::favorited: boolean,lowertweets::favorite_count: long,lowertweets::retweet_count: long,lowertweets::retweeted: boolean,lowertweets::place: map[chararray])}} 

スクリプト: -

STORE A INTO 'google_1473673952_265276863360/tweets' USING org.elasticsearch.hadoop.pig.EsStorage('es.nodes = ip:9200','es.mapping.pig.tuple.use.field.names = true'); 

カールスクリプト: -

curl -XPUT 'http://hostname:9200/google_1473673952_265276863360/_mapping/tweets' -d ' {  "tweets" :{  "properties" : {   "pattern" : " {"type" : "string", "store" : true}, "created_at" : {"type" : "string", "store" : true },"id" : {"type" : "string", "store" : true }, "id_str" : {"type" : "string", "store" : true },"text" : {"type" : "string", "store" : true },"source" : {"type" : "string", "store" : true },"entities" : {"type" : "string", "store" : true },"favorited" : {"type" : "boolean", "store" : true },"favorite_count" : {"type" : "string", "store" : true },"retweet_count" : {"type" : "string", "store" : true },"retweeted" : {"type" : "boolean", "store" : true },"place" : {"type" : "string", "store" : true } }}}' 

エラー: -

のjava.lang.Exception:にjava.io.IOException:java.lang.StringIndexOutOfBoundsException:アウト文字列のインデックス範囲:-1 at org.apache.hadoop.mapred.LocalJobRunner $ Job.runTasks(LocalJobRunner.java:462)at org.apache.hadoop.mapred.LocalJobRunner $ Job.run(LocalJobRunner.java:529)によって引き起こされる:java.io.I OException:java.lang.StringIndexOutOfBoundsException:文字列インデックスが範囲外です。-1でorg.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapReduce $ Reduce.runPipeline(PigGenericMapReduce.java:479)at org.apache.pig。 backend.hadoop.executionengine.mapReduceLayer.PigGenericMapReduce $ Reduce.processOnePackageOutput(PigGenericMapReduce.java:442は)

私はカールでデータ型を変更してみましたが、それは

任意の助けを私に働いていなかった

答えて

0

あなたマッピングにはエラーがあり、余分な "。 java.io.IOException:java.lang.StringIndexOutOfBoundsException:文字列

はOk..Iはそれを修正し、それがagain.Butまだ同じissue.java.lang.Exceptionを取得しようとしたこの

{ "properties" : { "pattern" : {"type" : "string", "store" : true}, "created_at" : {"type" : "string", "store" : true },"id" : {"type" : "string", "store" : true }, "id_str" : {"type" : "string", "store" : true },"text" : {"type" : "string", "store" : true },"source" : {"type" : "string", "store" : true },"entities" : {"type" : "string", "store" : true },"favorited" : {"type" : "boolean", "store" : true },"favorite_count" : {"type" : "string", "store" : true },"retweet_count" : {"type" : "string", "store" : true },"retweeted" : {"type" : "boolean", "store" : true },"place" : {"type" : "string", "store" : true } }} 
+0

を使用してみてくださいインデックスが範囲外です:-1でorg.apache.hadoop.mapred.LocalJobRunner $ Job.runTasks(LocalJobRunner.java:462)at org.apache.hadoop.mapred.LocalJobRunner $ Job.run(LocalJobRunner.java:529) java.io.IOException:java.lang.StringIndexOutOfBoundsException:文字列インデックスが範囲外です。-1 – Bunny

関連する問題