私はどうにかして結合後にキーを削除しているようです。豚:参加後にフィールドが存在しない
コンテキスト
目標は、唯一のtable_1は異なる会員IDで構成されてtable_2からすべてのレコードを取得することです。
初心者でも、この目標を達成するためのベストプラクティスの指針と、「投影フィールド」エラーが発生する理由に関するコメントをお待ちしております。
私は
-- assume %default vals set for path_1 and path_2 to data
-- load the data
table_1 = LOAD '$path_1' as (day, member_id, country);
table_2 = LOAD '$path_2' as (day, member_id, country);
-- get distinct member_id's from table_1
table_1_ids = DISTINCT(FOREACH table_1 GENERATE member_id as member_id);
-- get all records from table_2 that only have table_1_ids
new_table_2 = JOIN table_1_ids BY member_id, table_2 BY member_id;
エラー
無効なフィールド投影を試みた何。フィールド[member_id]がスキーマに存在しません:table_1_ids :: member_id:bytearray、table_2 :: day:bytearray、table_2 :: member_id:bytearray、table_2 :: country:bytearray。
便利な場合:new_table_2 = table_2 [:Pythonのパンダでは、これはのような単純なものでしょう – Quetzalcoatl
こんにちはQuetzalcoatl、私が気づくのは、豚スクリプトの最後の行でmember_idにする必要があるメンバーIDです - > new_table_2 –
また、このスクリプトで別のやり方を確認してください - > table_1_ids –