如何将源中的行键映射到接收器中的行键?没有按预期工作

问题描述 投票:0回答:1

我正在使用 Azure 数据工厂来转换 blob,然后尝试将其复制到 Azure 表存储中。我正在使用复制活动。管道由数据流和复制活动组成。

除了映射我的行键之外,一切都运行良好。我使用转换活动根据产品 SKU 生成行键。当我去接收器并选择“使用源列”时,它在“行键列”下显示一个“选择选项”,但我唯一的选项是“添加动态内容”,并且我没有得到任何列选项。

源中的行键是通过映射函数映射的,但似乎在不指定动态内容的情况下,默认情况下它会被唯一标识符覆盖。由于这些是产品 SKU,并且我想合并数据,因此我绝对需要自己的行键。

我是 ADF 新手,我尝试使用动态内容引用我的 rowkey,但它只会生成未找到的错误。我不确定在编写表达式时是否正确引用了源代码。

我已联系 Azure 支持,正在等待回复,但我们拭目以待。

{
    "name": "BlobTransformsToTable",  
    "properties": {  
        "activities": [  
            {
                "name": "TransformThenCopyToTable",  
                "type": "Copy",  
                "dependsOn": [  
                    {  
                        "activity": "MyVendorCatalog",  
                        "dependencyConditions": [  
                            "Succeeded"  
                        ]  
                    }  
                ],  
                "policy": {  
                    "timeout": "7.00:00:00",  
                    "retry": 0,  
                    "retryIntervalInSeconds": 30,  
                    "secureOutput": false,  
                    "secureInput": false  
                },  
                "typeProperties": {  
                    "source": {  
                        "type": "DelimitedTextSource",  
                        "storeSettings": {  
                            "type": "AzureBlobStorageReadSetting",  
                            "wildcardFileName": "*.*"  
                        },  
                        "formatSettings": {  
                            "type": "DelimitedTextReadSetting"  
                        }  
                    },  
                    "sink": {  
                        "type": "AzureTableSink",  
                        "azureTableInsertType": "merge",  
                        "azureTableDefaultPartitionKeyValue": "CatalogItem",  
                        "writeBatchSize": 10000  
                    },  
                    "enableStaging": false,  
                    "translator": {  
                        "type": "TabularTranslator",  
                        "mappings": [  
                            {  
                                "source": {  
                                    "name": "PartitionKey",  
                                    "type": "String"  
                                },
                                "sink": {  
                                    "name": "PartitionKey"  
                                }  
                            },  
                            {  
                                "source": {  
                                    "name": "RowKey",  
                                    "type": "String"  
                                },  
                                "sink": {  
                                    "name": "RowKey"  
                                }  
                            },  

Screenshot1 Screenshot2

我希望它将源中的 rowkey 映射到接收器中的 rowkey。它仍在产生独特的价值。我愿意通过使用动态内容来解决这个问题,但我不确定如何让它发挥作用。

azure azure-table-storage azure-data-factory
1个回答
0
投票

我遇到了类似的问题,并能够按照以下方式解决。

编辑管道并导航到 [Sink] 选项卡

  • 【Row Key值选择】应指定为“使用Sink Column”
  • 打开[添加动态内容选择]屏幕时,应将[行键列]指定为“RowKey”

然后在映射屏幕上,您可以将源字段映射到“RowKey”列,它将受到尊重

Row Key Column screenshot

© www.soinside.com 2019 - 2024. All rights reserved.