SQL Server Bulk Insert Parquet Files in Azure SQL

0mkxixxg  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(120)

I am trying to load a parquet file into Azure SQL Database based on an example here on SO. However, I'm getting a syntax error. I don't see much documentation on Microsoft website or enough information on Google. So, seeking help from experts here. FYI - I have already created the DATA_SOURCE.

Creating External Data Source:

CREATE EXTERNAL DATA SOURCE [my_azure_blob_storage]
WITH (
        LOCATION = N'abfss://xxxxxxx.dfs.core.windows.net', 
        CREDENTIAL = [myblobStorage] ,
        TYPE = BLOB_STORAGE
);

Doing BULK INSERT:

BULK INSERT [dbo].[Employees]
FROM 'gold/employees'
WITH
    (
        DATA_SOURCE = 'my_azure_blob_storage',
        FORMAT = 'PARQUET',
        FIRSTROW = 2
    );

And the error I am getting is:

Msg 102, Level 15, State 1, Line 6 Incorrect syntax near 'FORMAT'.

kmpatx3s

kmpatx3s1#

Currently the only FORMAT supported in BULK INSERT or OPENROWSET is CSV.

You can use Azure Data Factory or Spark to bulk load SQL Server from a parquet file, or to prepare a CSV file for BULK INSERT or OPENROWSET.

UPDATE: Support for Delta and Parquet have ben added to OPENROWSET SQL Server 2022.

相关问题