在Azure数据工厂中基于行号进行透视-映射数据流 [英] Pivoting based on Row Number in Azure Data Factory - Mapping Data Flow
本文介绍了在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?
谢谢.
推荐答案
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:
- 我的投影标签如下:
- 我的 DataPreview 是这样的:
- 在 Pivot1 活动中,我们选择 Table_Name 和 Row_Number 列进行分组.如果您不想使用 Table_Name 列,可以在此处将其删除.
- 在枢轴键标签上,选择颜色名称列.
- 在枢轴列中,我们必须选择一个agrregate函数来汇总 Value 列,这里我使用max().
- 结果显示:
- My Projection tab is like this:
- My DataPreview is like this:
- 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.
- At Pivote key tab, we select Col_Name column.
- At Pivoted columns, we must select a agrregate function to aggregate the Value column, here I use max().
- The result shows:
如果我理解您的回答有误,请纠正我.
Please correct me if I understand you wrong in the answer.
更新:
- 像这样的数据源:
- 结果显示如您所说,ADF按字母顺序对列进行排序,似乎无法自定义排序方式:
- 但是,当我们完成接收器活动时,它将自动映射到您的sql结果表中.
- The data source like this:
- The result shows as you saied, ADF sorts the column alphabetically.It seems no way to customize sorting:
- But when we done the sink activity, it will auto mapping into your sql result table.
这篇关于在Azure数据工厂中基于行号进行透视-映射数据流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文