简体   繁体   English

Azure 数据工厂复制活动动态映射错误:语法错误:arguments 之间缺少逗号

[英]Azure data factory copy activity dynamic mapping error : Syntax error: Missing comma between arguments

I am trying to convert json to csv and want to use dynamic mapping instead of manual mapping.我正在尝试将 json 转换为 csv 并希望使用动态映射而不是手动映射。 I dynamic mapping I see an error message Syntax error: Missing comma between arguments我动态映射我看到一条错误消息 Syntax error: Missing comma between arguments

below is the json iam trying to add in dynamic content下面是我试图添加动态内容的 json

{
            "type": "TabularTranslator",
            "mappings": [
                {
                    "source": {
                        "path": "$['longitude']"
                    },
                    "sink": {
                        "name": "longitude",
                        "type": "String"
                    }
                },
                {
                    "source": {
                        "path": "$['City']"
                    },
                    "sink": {
                        "name": "City",
                        "type": "String"
                    }
                },
                {
                    "source": {
                        "path": "$['temeprature']"
                    },
                    "sink": {
                        "name": "temeprature",
                        "type": "String"
                    }
                },
                {
                    "source": {
                        "path": "$['max']"
                    },
                    "sink": {
                        "name": "max",
                        "type": "String"
                    }
                },
                {
                    "source": {
                        "path": "$['speed']"
                    },
                    "sink": {
                        "name": "speed",
                        "type": "String"
                    }
                }
            ]
        }
    

See error message in this screenshot在此屏幕截图中查看错误消息

1

The error is occurring because the incorrect format used to specify dynamic mapping.发生错误是因为用于指定动态映射的格式不正确。 The following is a demonstration on the same.以下是关于相同的演示。

  • I got the same error when I used the JSON syntax that you have used for mapping columns dynamically ie, Syntax error: Missing comma between arguments .当我使用用于动态映射列的 JSON 语法时,我遇到了同样的错误,即Syntax error: Missing comma between arguments

在此处输入图像描述

  • Since we are mapping the source columns (json) to destination (csv), we can specify the source in the mapping as "name": "longitude" .由于我们将源列 (json) 映射到目标 (csv),我们可以将映射中的源指定为"name": "longitude" I considered only longitude column for this demonstration and the following is the JSON that I used for mapping:我只考虑了这个演示的经度列,以下是我用于映射的 JSON:
@json('{
            "type": "TabularTranslator",
            "mappings": [
                {
                    "source": {
                        "name": "longitude"
                    },
                    "sink": {
                        "name": "longitude",
                        "type": "String"
                    }
                },
                {
                    "source": {
                        "name": "city"
                    },
                    "sink": {
                        "name": "city",
                        "type": "String"
                    }
                }
            ]
        }'
)
  • When the pipeline is run, it successfully writes the input JSON file as a CSV (below is the image of my csv output).当管道运行时,它成功地将输入 JSON 文件写入为 CSV(下图是我的 csv 输出的图像)。

在此处输入图像描述

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

相关问题 将 JSON 映射到 SQL 的 Azure 数据工厂复制活动错误 - Azure Data Factory Copy Activity error mapping JSON to SQL Azure数据工厂数据复制源中的查找活动-语法错误 - Lookup activity in an Azure Data Factory Data Copy Source - Syntax Error 值 2150002867256 的复制活动中的类型转换错误:Azure 数据工厂 - Type Conversion Error in Copy activity for value 2150002867256: Azure data factory 使用触发器中的 Azure 数据工厂复制数据活动映射 - Azure Data Factory Copy Data Activity Mapping in Using Triggers Azure Data Factory V2复制活动映射部署问题 - Azure Data Factory V2 Copy activity Mapping deployment issue Azure 数据工厂 - 复制数据 - 映射 - 动态内容表达式 - Azure Data Factory - Copy data - mapping - dynamic content expression 应该使用什么语法来读取 Azure 数据工厂/突触中“复制数据”活动的“映射”选项卡上的数组中的最后一行? - What syntax should be used for reading the final row in an Array on the Mapping tab on the Copy Data activity in Azure Data Factory / Synapse? Azure 数据工厂 (V2) 复制活动 - 缺少高级编辑器 - Azure Data Factory (V2) Copy Activity - advanced editor missing 如何禁用 Azure 数据工厂中两个活动之间的映射 - How to disable the mapping between two activity in Azure Data Factory Azure数据工厂复制活动 - Azure Data Factory Copy Activity
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM