Analysis-Services/UsqlScripts/large_multiple/store_sales_1-25.usql

57 строки
1.3 KiB
Plaintext

@raw_parsed = EXTRACT child_id int,
ss_sold_date_sk string,
ss_sold_time_sk string,
ss_item_sk string,
ss_customer_sk string,
ss_cdemo_sk string,
ss_hdemo_sk string,
ss_addr_sk string,
ss_store_sk string,
ss_promo_sk string,
ss_ticket_number string,
ss_quantity string,
ss_wholesale_cost string,
ss_list_price string,
ss_sales_price string,
ss_ext_discount_amt string,
ss_ext_sales_price string,
ss_ext_wholesale_cost string,
ss_ext_list_price string,
ss_ext_tax string,
ss_coupon_amt string,
ss_net_paid string,
ss_net_paid_inc_tax string,
ss_net_profit string,
empty string
FROM "wasb://store-sales@<blob storage account name>/{*}_{child_id}_100.dat"
USING Extractors.Text(delimiter: '|');
@filtered_results = SELECT ss_sold_date_sk,
ss_sold_time_sk,
ss_item_sk,
ss_customer_sk,
ss_cdemo_sk,
ss_hdemo_sk,
ss_addr_sk,
ss_store_sk,
ss_promo_sk,
ss_ticket_number,
ss_quantity,
ss_wholesale_cost,
ss_list_price,
ss_sales_price,
ss_ext_discount_amt,
ss_ext_sales_price,
ss_ext_wholesale_cost,
ss_ext_list_price,
ss_ext_tax,
ss_coupon_amt,
ss_net_paid,
ss_net_profit
FROM @raw_parsed
WHERE child_id BETWEEN 1 AND 25;
OUTPUT @filtered_results
TO "/large_multiple/store_sales.csv"
USING Outputters.Csv(outputHeader: true);