简体   繁体   English

数据工厂中的 Azure cosmos db 错误 - 数据流接收器 -> 作业失败,原因是:从 StructType 转换

[英]Azure cosmos db error in data factory - data flow sink -> job failed due to reason: Conversion from StructType

I'm building a simple data flow in azure data factory to get some specific data from a content hub location.我正在天蓝色数据工厂中构建一个简单的data flow ,以从内容中心位置获取一些特定数据。 This information is in json format.此信息为 json 格式。

Transformations:转换:

  1. Source: rest API get method to retrieve the data from the URL来源: rest API get 方法从 URL 中检索数据
  2. Transformation 1: flatten to put into rows an item list that contains all the articles.转换 1: flatten以将包含所有文章的项目列表放入行中。
  3. Transformation 2: select to chose specific attributes from each items in the list.转换 2: select以从列表中的每个项目中选择特定属性。
  4. Transformation 3: alter row to upsert data if condition true()转换 3:如果条件为true() ,则更alter rowupsert数据
  5. Sink: using cosmosdb dataset to load the selected data into a collection. Sink:使用 cosmosdb 数据集将选定的数据加载到集合中。

The problem is with the last item elements since this is a StructType {} :问题在于最后一项elements ,因为这是StructType {}

elements: {
  headline: {
    title: "Title",
    dataType: "string",
    name: "headline",
    variations: { },
    multiValue: false,
    :type: "string",
  },
  alternativeHeadline: {
    title: "Subtitle",
    dataType: "string",
    name: "alternativeHeadline",
    variations: { },
    multiValue: false,
    :type: "string",
  },
  author: {
    title: "Author",
    dataType: "string",
    name: "author",
    variations: { },
    multiValue: false,
    :type: "string",
  },
...
}

When I run the job I'm getting this error:当我运行作业时,我收到此错误:

{"StatusCode":"DFExecutorUserError","Message":"Job failed due to reason: Conversion from StructType(StructField(headline,StructType(StructField(:type,StringType,true), StructField(dataType,StringType,true), StructField(multiValue,BooleanType,true), StructField(name,StringType,true), StructField(title,StringType,true), StructField(value,StringType,true), StructField(variations,StructType(StructField(mobile,StructType(StructField(:type,StringType,true), StructField(dataType,StringType,true), StructField(multiValue,BooleanType,true), StructField(name,StringType,true), StructField(title,StringType,true), StructField(value,StringType,true)),true), StructField(spanish,StructType(StructField(:type,StringType,true), StructField(dataType,StringType,true), StructField(multiValue,BooleanType,true), StructField(name,StringType,true), StructField(title,StringType,true), StructField(value,StringType,true)),true)),true)),true), StructField(icon,StructType(StructField(:type,StringType,true), StructField(dataType,StringType,true), StructField(multiValue,BooleanType,true),","Details":""}

It seems one ore more data struct types are wrong from the source vs the target but I would like this to be dynamic.从源到目标,似乎一个或多个数据结构类型是错误的,但我希望这是动态的。 Since it is some metadata, the attribute can or can't be there.由于它是一些元数据,因此该属性可以存在或不存在。

I tried using a copy activity directly in a pipeline using the same dataset and it worked fine the problem is I'll need to transform the data later and the copy activity is limited in this aspect.我尝试使用相同的数据集直接在管道中使用copy activity ,它运行良好,问题是我稍后需要转换数据,并且复制活动在这方面受到限制。 Any thoughts?有什么想法吗?

I found the root of the problem.我找到了问题的根源。 In the dataset, I imported the schema, once I cleared it, the struct data type verification stopped in the data-flow.在数据集中,我导入了模式,一旦我清除它,结构数据类型验证就会在数据流中停止。 The load ran successfully.负载运行成功。

暂无
暂无

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

相关问题 Azure 数据工厂和 Cosmos DB - Azure Data Factory and Cosmos DB 使用数据工厂从cosmos db作为源的复制活动时出错 - Error using data factory for copyactivity from cosmos db as source 使用Azure Data Factory将Azure cosmos db中的json数据复制到Azure sql - Copy json data from Azure cosmos db to Azure sql using Azure Data Factory Azure 数据工厂 - 将数据从 ADLS 复制到 Cosmos DB - 在创建 ADLS 作为源的连接时出错 - Azure Data Factory- Copy data from ADLS -to Cosmos DB - getting error while creating connection for ADLS as source Azure 数据工厂复制活动失败将字符串(从 csv)映射到 Azure SQL 表接收器 uniqueidentifier 字段 - Azure Data factory copy activity failed mapping strings (from csv) to Azure SQL table sink uniqueidentifier field ADF(azure数据工厂)将数据从SQL Server复制到Cosmos DB,其中字段包含json对象 - ADF (azure data factory) copy data from SQL Server to Cosmos DB with field contain json object 从cosmos db查询特定的时间范围数据,并通过azure数据工厂将其存储在sql数据库中 - Query a specific time range data from cosmos db and store it in sql database via azure data factory 无法在 azure 数据工厂中获取对 cosmos db 的查询的标量值 - Unable to get scalar value of a query on cosmos db in azure data factory Azure 数据流/数据工厂错误处理 - Azure Data Flow / Data factory Error Handling Azure 数据工厂中的条件接收器 - Conditional sink in Azure data factory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM