在读取存储在ADL中的CSV时,在Azure数据工厂中发现的列比预期的列数还多。

发布于 2025-02-09 10:39:00 字数 1398 浏览 3 评论 0原文

我正在以CSV格式导出F& d365数据。现在,我正在尝试读取存储在ADL中的CSV,并使用Azure Data Factory复制到Azure Synapse专用SQL Pool表中。但是,我可以创建管道,并且它可以在几个桌子上工作,没有任何问题。但是,由于列数不匹配,因此一张表(salesline)失败了。 以下是CSV格式样本,CSV中没有列名(标题),因为它已从f& o系统和列名称中存储在Salesline.cdm.json文件中。

5653064010 ,,“ 2022-06-03T20:07:38.7122447Z”,5653064010,“ B775-92”

07:07:38.71222447Z”,565330406533040404065304065304040404065330404065304065330404040404065303330406530333040653040404065304040653033033040.5653304040404040404040404040400号零售店

5653064011 ,,,“ 20222-06-03T20:07:07:07 : ,“ 2022-06-03T20:07:38.7122447Z”,5653064012,“ Somedata”

5653064013 ,,,“ 2022-06-06-03T20:07:07:07:38.7122447Z

” ,“ 2022-06-03T20:07:38.7122447Z”,5653064014,“ parcel”

5653064016 ,,,“ 2022-06-06-03T20:07:07:07:07:38.7122447Z Test3

我使用复制数据活动创建了ADF管道,以将ADLS(CSV)的数据复制到Synapse SQL表中,但是我要低于错误。

在目标copy_hs1上操作失败:errorcode = delimitedTextMoreColumnSthandSthed,'type = microsoft.datatransfer.common.common.shared.hybriddeliveryexception,Message =错误在处理处理'csv/tsv/tsv格式时发现的'corece'source'source'sarefor's sarreetline_00001.csv'时/strong>:找到比预期列数6 。,source = microsoft.datatransfer.common的列更多的列,'

列映射看起来像在下面 - 因为CSV第一行具有6列,因此仅在导入时出现6个列模式。

I am exporting F&O D365 data to ADLS in CSV format. Now, I am trying to read the CSV stored in ADLS and copy into Azure Synapse dedicated SQL pool table using Azure data factory. However, I can create the pipeline and it's working for few tables without any issue. But it's failing for one table (salesline) because of mismatch in number of column.
Below is the CSV format sample, there is no column name(header) in CSV because it's exported from F&O system and column name stored in salesline.CDM.json file.

5653064010,,,"2022-06-03T20:07:38.7122447Z",5653064010,"B775-92"

5653064011,,,"2022-06-03T20:07:38.7122447Z",5653064011,"Small Parcel"

5653064012,,,"2022-06-03T20:07:38.7122447Z",5653064012,"somedata"

5653064013,,,"2022-06-03T20:07:38.7122447Z",5653064013,"someotherdata",,,,test1, test2

5653064014,,,"2022-06-03T20:07:38.7122447Z",5653064014,"parcel"

5653064016,,,"2022-06-03T20:07:38.7122447Z",5653064016,"B775-92",,,,,,test3

I have created ADF pipeline using copy data activity to copy the data from ADLS(CSV) to Synapse SQL table however I am getting below error.

Operation on target Copy_hs1 failed: ErrorCode=DelimitedTextMoreColumnsThanDefined,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Error found when processing 'Csv/Tsv Format Text' source 'SALESLINE_00001.csv' with row number 4: found more columns than expected column count 6.,Source=Microsoft.DataTransfer.Common,'

Column mapping looks like below- Because CSV first row has 6 column so it's appearing 6 only while importing schema.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦在深巷 2025-02-16 10:39:00

我已经使用您的示例数据,并在使用复制数据 Activity复制文件时遇到了相同的错误。

另外,我尝试使用数据流来复制文件,并能够加载数据而没有任何错误。

源文件:

“在此处输入图像说明”

数据流:

  1. 源数据集:仅读取前6列,因为第一行只包含文件中的6列。

  1. 源转换:在源转换中连接源数据集。

来源预览:

“在此处输入图像说明”

  1. 接收器转换:连接接收器与Synapse数据集。

设置:

”在此处输入图像描述”

mappings:

​strong>

  1. 运行数据流后,将数据加载到源 Synapse表

I have repro’d with your sample data and got the same error while copying the file using the copy data activity.

Alternatively, I have tried to copy the file using data flow and was able to load the data without any errors.

Source file:

enter image description here

Data flow:

  1. Source dataset: only the first 6 columns are read as the first row contains only 6 columns in the file.

enter image description here

  1. Source transformation: connect source dataset in source transformation.

enter image description here

Source preview:

enter image description here

  1. Sink transformation: Connect sink to synapse dataset.

enter image description here

Settings:

enter image description here

Mappings:

enter image description here

Sink output:

enter image description here

  1. After running the data flow, data is loaded to the sink synapse table.

enter image description here

给我一枪 2025-02-16 10:39:00

将我的CSV更改为XLSX,可以帮助我在复制活动ADF中解决此问题。

Change my csv to xlsx help me to solve this problem in Copy Activity ADF.

感性 2025-02-16 10:39:00

1.从复制数据设置设置“ FART TORENAME” =“跳过不兼容行”
跳过不兼容的行
2.从数据集连接设置设置逃脱字符到双引号
逃脱字符

1.From Copy data settings set "Fault Tolerance" = "Skip Incompatible rows"
skip incompatible rows
2.From Dataset connection settings set Escape character to Double quotes
Escape character

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文