質問の誤った表現のために申し訳ありません。 私はstackoverflowだけでなく、私は全く新しいPIGと私自身で実験しようとしています。PIG:CONCAT別の関係への出力
私は、words.t fileとdata.txtファイルを処理するシナリオを持っています。
words.txt
word1
word2
word3
word4
data.txtを
{"created_at":"18:47:31,Sun Sep 30 2012","text":"RT @Joey7Barton: ..give a word1 about whether the americans wins a Ryder cup. I mean surely he has slightly more important matters. #fami ...","user_id":450990391,"id":252479809098223616}
Iとして出力を取得する必要が
(word1_epochtime){text属性にマッチした完全なデータ}
つまり
(word1_1234567890){"created_at":"18:47:31,Sun Sep 30 2012","text":"RT @Joey7Barton: ..give a word1 about whether the americans wins a Ryder cup. I mean surely he has slightly more important matters. #fami ...","user_id":450990391,"id":252479809098223616}
私は
として(単語1){ "created_atと" 出力に含まを持っている: "18:47:31、日2012年9月30日"、 "テキスト": "RT @ Joey7Bartonを:。アメリカ人がライダーカップに勝ったかどうかについては、 word1。私は確かに彼は が少し重要な問題を抱えていることを意味します。 #fami ... "" user_idは ":450990391、" ID」:252479809098223616}
このスクリプトを使用して
load words.txt
load data.txt
c = cross words,data;
d = FILTER c BY (data::text MATCHES CONCAT(CONCAT('.*',words::word),'.*'));
e = foreach (group d BY word) {data);
と私は
として言葉でepochtimeを得ましたtime = FOREACH words GENERATE CONCAT(CONCAT(word,'_'),(chararray)ToUnixTime(CurrentTime(created_at));
しかし、私は時間との言葉をCONCATすることができません。
私は
として出力を得ることができますどのように(word1_time){data}
上記にお気軽にお問い合わせください。 ありがとうございます。
Amitの再生に感謝します。実際に私の間違いは私が正しく言及しなかったことです。私はcreated_at属性に基づいてエポックタイムを取得しています。私は質問を編集しました。一度再確認してください。 – Bunny