azure-data-factory - 使用参数的 Azure 数据工厂数据流表达式生成器

标签 azure-data-factory

我尝试将管道参数传递给数据流事件,同时尝试传递目录/文件夹的值。由于 concat('myArchive/', $myFolderDF) 给了我错误:文字表达式中不允许使用列操作数。我尝试使用此 '{$myFolderDF}' 但仍然收到错误。您能否指导我在数据流事件的表达式中使用参数。

JSON:

parameters{
    myFolderDF as string
}
source(allowSchemaDrift: true,
    validateSchema: false,
    ignoreNoFilesFound: false,
    format: 'csv',
    fileSystem: 'FileSource',
    folderPath: (concat('myFileArchive/',$myFolderDF)),
    fileName: (concat(lower($myFolderDF),'.csv')),
    documentForm: 'documentPerLine') ~> DFSource
DFSource sink(allowSchemaDrift: true,
    validateSchema: false,
    format: 'csv',
    fileSystem: 'FileArchive',
    folderPath: (concat('myFileArchive/',$myFolderDF)),
    partitionFileNames:[(concat($myFolderDF,toString(currentTimestamp(),'MMddyyyy'),'.csv'))],
    umask: 0022,
    preCommands: [],
    postCommands: [],
    skipDuplicateMapInputs: true,
    skipDuplicateMapOutputs: true,
    saveOrder: 0,
    partitionBy('hash', 1)) ~> DFFileArchive

PipelineParameter

DataflowParameter

最佳答案

当我触发管道运行时,我能够正确获取它。请检查以下配置示例。

假设这与数据集参数无关并且源数据集没有提供显式文件路径

enter image description here

数据流配置:

数据流参数: get_dir

enter image description here

通配符路径: concat('my/',$get_dir)

enter image description here

enter image description here

管道参数: pipe_param

enter image description here

分配给数据流参数:

get_dir: @pipeline().parameters.pipe_param

enter image description here

传递动态值:

原始文件位置:source/my/myArchive/mysource(1).csv

参数化:source/concat('my/',$get_dir)

动态值:myArchive/*.csv

enter image description here

enter image description here

关于azure-data-factory - 使用参数的 Azure 数据工厂数据流表达式生成器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69671550/

相关文章:

azure - 在数据工厂中映射数据流时出现无转义字符错误

azure - ADF - 如何将具有不同标题的多个 CSV 加载到一个目标表中

json - Azure 数据工厂获取元数据以获取 blob 文件名并将其传输到 Azure SQL 数据库表第 2 部分

azure - 如何更改Azure数据工厂中的WindowStart WindowEnd?

.net - 错误请求。,Source=Microsoft.WindowsAzure.Storage,StorageExtendedMessage=不支持 block blob

c# - 使用 Azure Functions 自动将 Excel 保存为 CSV

azure-sql-database - Azure Data Factory V2如何处理azure分析服务cube

azure - ForEach 事件如何在数据工厂中宣告成功?

azure - 如何在 Azure DataFactory 中设置 SAP ABAP 的集成运行时

azure - 无法使用 ADF 脚本事件中的参数调用 Snowflake 过程