Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CREATE VIEW [dbo].[vFactSalesOrder_Parquet] AS
SELECT SOH.[SalesOrderID]
,SOH.[RevisionNumber]
,SOH.[OrderDate]
,SOH.[DueDate]
,SOH.[ShipDate]
,SOH.[Status]
,SOH.[OnlineOrderFlag]
,SOH.[SalesOrderNumber]
,SOH.[PurchaseOrderNumber]
,SOH.[AccountNumber]
,SOH.[CustomerID]
,SOH.[ShipToAddressID]
,SOH.[BillToAddressID]
,SOH.[ShipMethod]
,SOH.[CreditCardApprovalCode]
,SOH.[SubTotal]
,SOH.[TaxAmt]
,SOH.[Freight]
,SOH.[TotalDue]
,SOH.[Comment]
,SOH.[rowguid]
,SOD.[SalesOrderDetailID]
,SOD.[OrderQty]
,SOD.[ProductID]
,SOD.[UnitPrice]
,SOD.[UnitPriceDiscount]
FROM OPENROWSET(
BULK 'https://<storageAccountName>.blob.core.windows.net/raw/reservoir/adventureworkslt/2020/01/01/SalesLT.salesorderheader_full.parquet',
FORMAT='PARQUET'
) AS SOH
INNER JOIN OPENROWSET(
BULK 'https://<storageAccountName>.blob.core.windows.net/raw/reservoir/adventureworkslt/2020/01/01/SalesLT.salesorderdetail_full.parquet',
FORMAT='PARQUET'
) AS SOD
ON SOH.SalesOrderID = SOD.SalesOrderID
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment