简体   繁体   中英

Azure Data Factory Copying a cell value incorrectly when copying data from Azure Blob Storage To Azure SQLDB

I am in the process of building a grocery list app with Azure.

Currently, I have an azure function that writes json files to blob storage. Here is what my current blob storage looks like:来自 ADF 的 Blob 存储中的数据图片 When Azure data factory copies over the data to my SQL DB, this is what it looks like:我的购物清单表的图片 Here is the code that I am using to create my table:

-- Create a new table called 'groceryitems' in schema 'grocerylistapp'
-- Drop the table if it already exists
IF OBJECT_ID('grocerylistapp.groceryitems', 'U') IS NOT NULL
DROP TABLE grocerylistapp.groceryitems
GO

CREATE SCHEMA grocerylistapp
GO

-- Create the table in the specified schema
CREATE TABLE grocerylistapp.groceryitems
(
    id INT IDENTITY(1,1), -- Primary Key column
    epoch DATE,
    [name] VARCHAR(50),
    PRIMARY KEY CLUSTERED([id] ASC)
    -- Specify more columns here
);
GO
1

Oddly enough, when I originally did this with Data Warehouse / Synapse, I didn't get this issue, so I am assuming it is something to do particularly with SQL DB.

I also want to add that it randomly decides to distort one row, if I had 3,4, or 5 items in blob storage, it would pick one row and distort it as shown in the screenshot. It is not always the same item.

Thank you.

Firstly, make sure you have chosen the json format file as Soure dataset.

Here're the steps I tested, and it works well.

Source dataset(json format) from Blob storage:

在此处输入图片说明

Import the cchema of the source dataset: 在此处输入图片说明

Sink dataset settings:

在此处输入图片说明

Mapping settings:

在此处输入图片说明

Run the pipeline:

在此处输入图片说明

Check the data in table grocerylistapp.groceryitems :

在此处输入图片说明

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM