Hi @brekrut , this table I am going to use in my accelarated datstore, hence there is no particular dataset/schema I have, rather the table that I have created:
CREATE TABLE purchase_line_item_test AS
SELECT cast(null as string) order_number,
cast(null as string) email,
cast(null as string) product_hier_code ,
cast(null as string) product_name,
cast(0 as integer) quantity,
cast(0.00 as decimal(28,2)) price,
cast(null as string) sku;
I think I did the incorrect way.
Right one:
INSERT INTO purchase_line_item_test
With combined_result AS (
SELECT "Order Number"
, valid_profiles.email_address as "Email"
, "Product Hierarchy Code"
, "Product Name"
, "Quantity"
, "Price"
, "SKU"
FROM purchases)
SELECT "Order Number", "Email, "Product Hierarchy Code", "Product Name", "Quantity", "Price", "SKU"
FROM combined_result;