"""Query template to load mech results data from S3 into art_relations.publishing_escrow.""" from jinja2 import Template def load_mechanical_deduction_results_into_publishing_escrow() -> Template: """Load mech results from s3 into art_relations.publishing_escrow.""" return Template(""" LOAD DATA FROM S3 '{{s3_url}}' INTO TABLE publishing_escrow FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' IGNORE 1 LINES -- ignore file header ( @mechanical_transaction_id, @track_unique_id, @customer_id, @year, @quarter, @transaction_type, @quantity, @ownership, @royalty_rate, @royalty_amount, @statement_period_id ) SET statement_detail_id = @mechanical_transaction_id, track_id = @track_unique_id, dms_customer_id = @customer_id, year = @year, quarter = @quarter, trans_type = @transaction_type, qty = @quantity, ownership = @ownership, royalty_rate = @royalty_rate, royalty = @royalty_amount, period_id = @statement_period_id; """)