简体   繁体   English

具有附加列的 ADF 复制活动不起作用

[英]ADF Copy Activity with Additional Columns is Not working

My goal is to add some text to a file.我的目标是在文件中添加一些文本。 I used this post here to help me design this setup.在这里使用这篇文章来帮助我设计这个设置。

I have a set variable that sets a variable with some value.我有一个设置变量,它设置一个具有某个值的变量。 I then have a copy activity.然后我有一个复制活动。 This copy activity has an empty file for the source.此复制活动有一个用于源的空文件。 I then add in an additional column that uses my set variable.然后我添加了一个使用我的设置变量的附加列。 In sink I have a different file I hope to copy the contents of set variable to.在接收器中,我有一个不同的文件,我希望将设置变量的内容复制到。 When I run in debug mode, the sink file ends up empty.当我在调试模式下运行时,接收器文件最终为空。 The additional column is not being copied over.未复制附加列。 I tried with a mapping and then without.我尝试了映射,然后没有。 In both cases the same thing happened.在这两种情况下,同样的事情发生了。 设置变量 复制活动源 复制活动接收器 复制活动映射

Does anyone have any ideas or tips?有没有人有任何想法或提示?

I have tried and also seen the same empty data in the sink file as you mentioned.我已经尝试过并且在接收器文件中也看到了与您提到的相同的空数据。

在此处输入图像描述

Sink file:接收文件:

在此处输入图像描述

You can raise the support ticket or feel free to post your question in Microsoft Q&A forum where the product team will monitor them closely.您可以提出支持票或随时在Microsoft 问答论坛中发布您的问题,产品团队将密切关注他们。

I'm not sure the file based copy activity is supposed to work this way, you need input data/rows for it to enumerate.我不确定基于文件的复制活动是否应该以这种方式工作,您需要输入数据/行才能枚举。 If you have access to SQL server then you could simulate a dynamic SQL query to include the contents of your variable as a tabular output.如果您有权访问 SQL 服务器,那么您可以模拟动态 SQL 查询以将变量的内容包含为表格 output。 This can then define a source set of rows that could be appended into a file.然后,这可以定义可以附加到文件中的源行集。

For example, SQL for Source Query :例如,SQL 用于源查询

/*
    Bring in the value from your variable. use @@ to escape the SQL parameter name
    NOTE: Do not forget to escape single quotes if they exist in your string, replace ' with ''
*/
declare @@my_sql_var nvarchar(max) = '@{variables('fileContents')}';

/*
    Do some work here with this variable 
*/

/*
    Return the tabular response for the copy activity source query.
*/

select @@my_sql_var [VariableName];

Copy Activity - SQL Source复制活动 - SQL 源

在此处输入图像描述

Dynamic Expression for Source Query源查询的动态表达式

在此处输入图像描述

Preview Output预览 Output

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 ADF 复制一组文件 - Copy a set of files using ADF 什么是适用于 ADF 自定义 .NET 活动的兼容 .NET 框架? - What is the compatible .NET Framework for ADF Custom .NET Activity? 复制带有空标头的 Excel 文件 Azure 数据工厂 (ADF) - Copy an Excel file with empty headers Azure Data Factory (ADF) python function start_copy_from_url 未触发 Azure ADF 存储 BlobCreated 事件 - python function start_copy_from_url not triggering Azure storage BlobCreated event for ADF 是否可以将文件从 blob 存储/文件共享复制到 ADF 中的 FTP? - Is it possible to copy files from blob storage / file share into an FTP within an ADF? 使用数据流将 excel 文件加载到 ADF 中的 cosmos dB 时,列被删除 - Columns gets removed while loading an excel file to cosmos dB in ADF using data flow Azure Datafactory 从 SAP 系统对未分区数据的复制活动 - Azure Datafactory Copy activity from SAP system on Unpartitioned data 允许其他受保护的附加在 Azure 流分析中不起作用吗? - Allow additional protected appends not working in Azure Stream Analytics? Azure 数据工厂复制活动 - 附加到 JSON 文件 - Azure Data Factory Copy Activity - Append to JSON File JAR 活动在 Azure 数据工厂中未按预期工作 - JAR activity is not working as expected in Azure Data Factory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM