在Azure数据工厂中基于行号进行透视-映射数据流 [英] Pivoting based on Row Number in Azure Data Factory - Mapping Data Flow

查看:88
本文介绍了在Azure数据工厂中基于行号进行透视-映射数据流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Azure的新手,正在尝试查看没有Databricks的数据工厂/映射数据流是否可以实现以下结果.

I am new to Azure and am trying to see if the below result is achievable with data factory / mapping data flow without Databricks.

我有包含以下示例数据的csv文件:

I have my csv file with this sample data :

我的表中有以下数据:

我的预期数据/结果:

哪些转换有助于实现这一目标?

Which transformations would be helpful to achieve this?

谢谢.

推荐答案

现在,您有了RowNumber列,可以使用

Now, you have the RowNumber column, you can use pivot activity to do row-column pivoting.
I used your sample data to made a test as follows:

  1. 我的投影标签如下:
  2. 我的 DataPreview 是这样的:
  3. Pivot1 活动中,我们选择 Table_Name Row_Number 列进行分组.如果您不想使用 Table_Name 列,可以在此处将其删除.
  4. 枢轴键标签上,选择颜色名称列.
  5. 枢轴列中,我们必须选择一个agrregate函数来汇总 Value 列,这里我使用max().
  6. 结果显示:
  1. My Projection tab is like this:
  2. My DataPreview is like this:
  3. In the Pivot1 activity, we select Table_Name and Row_Number columns to group by. If you don't want Table_Name column, you can delete it here.
  4. At Pivote key tab, we select Col_Name column.
  5. At Pivoted columns, we must select a agrregate function to aggregate the Value column, here I use max().
  6. The result shows:

如果我理解您的回答有误,请纠正我.

Please correct me if I understand you wrong in the answer.

更新:

  1. 像这样的数据源:
  2. 结果显示如您所说,ADF按字母顺序对列进行排序,似乎无法自定义排序方式:
  3. 但是,当我们完成接收器活动时,它将自动映射到您的sql结果表中.
  1. The data source like this:
  2. The result shows as you saied, ADF sorts the column alphabetically.It seems no way to customize sorting:
  3. But when we done the sink activity, it will auto mapping into your sql result table.

这篇关于在Azure数据工厂中基于行号进行透视-映射数据流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆