次のようなファイル file_pattern があります。
SET default_parallel 10
SET pig.splitCombination true
SET pig.maxCombinedSplitSize 134217728
register 'hdfs:///usr/lib/pig/piggybank.jar';
define LENGTH org.apache.pig.piggybank.evaluation.string.LENGTH();
//Some other stuff goes here
そして、次のような別のファイルinsert_file:
ld_DW_D_INSTALLATION_PRODUCTS = load '/dan/data/dwh/dw_d_installation_products' using PigStorage ('|') as (inst_prod_wid , bac_wid , di
strict_code , billing_account_no , inst_sequence_no , product_code , contract_type , maintenance_contract , exchange_line_indicator , p
roduct_type , quantity , first_cph_date , last_cph_date , first_cph_term_expiry_date , last_cph_term_expiry_date , last_cph_order_no ,
ts_last_updated , data_owner , source_system , etl_created_dt);
ld_DEDUP_PROD_TPC_EXTRACT = load '/dan/data/dedup/dedup_prod_tpc_extract' using PigStorage ('|') as ( productfamilyid , productfamily ,
productgroupid , productgroup , grouplobid , productgroupowninglob , newproductid , newproductname , productowner , lifecycleid , life
cycle , buildgroupid , buildgroupname , ukbreleaseno , gs_productbuildstatusid , gs_productbuildstatus , ab_code , ab_codename , codelo
bid , codeowninglob , ab_codedestinyid , ab_codedestiny , ab_code_treatmentid , ab_code_treatmentstatus , gs_mappingstatusid , gs_mappi
ngstatus , consumercount , btb_count , gs_count , otherbu_count , operateflagid , operateflagdescription , withdrawalprojectid , withdr
awalproject , line_type , note );
今、私は次のような出力を与えるスクリプトが欲しいです:
SET default_parallel 10
SET pig.splitCombination true
SET pig.maxCombinedSplitSize 134217728
ld_DW_D_INSTALLATION_PRODUCTS = load '/dan/data/dwh/dw_d_installation_products' using PigStorage ('|') as (inst_prod_wid , bac_wid , di
strict_code , billing_account_no , inst_sequence_no , product_code , contract_type , maintenance_contract , exchange_line_indicator , p
roduct_type , quantity , first_cph_date , last_cph_date , first_cph_term_expiry_date , last_cph_term_expiry_date , last_cph_order_no ,
ts_last_updated , data_owner , source_system , etl_created_dt);
ld_DEDUP_PROD_TPC_EXTRACT = load '/dan/data/dedup/dedup_prod_tpc_extract' using PigStorage ('|') as ( productfamilyid , productfamily ,
productgroupid , productgroup , grouplobid , productgroupowninglob , newproductid , newproductname , productowner , lifecycleid , life
cycle , buildgroupid , buildgroupname , ukbreleaseno , gs_productbuildstatusid , gs_productbuildstatus , ab_code , ab_codename , codelo
bid , codeowninglob , ab_codedestinyid , ab_codedestiny , ab_code_treatmentid , ab_code_treatmentstatus , gs_mappingstatusid , gs_mappi
ngstatus , consumercount , btb_count , gs_count , otherbu_count , operateflagid , operateflagdescription , withdrawalprojectid , withdr
awalproject , line_type , note );
全体として、SETステートメントが最後に出現した後に2番目のファイルを挿入する必要があります。
よろしくお願いします