如何自动化此过程,以确保每当添加新数据或修改现有数据时更新镶木quet文件?任何有关设置触发器和自动化数据转换的指南将不胜感激。
也应该选择ADF和Azure功能吗?成本是我认为重要的:d所有这些工具的新知识:d
如果您只有对ADF的限制,则可以使用两个管道,6个数据流和一个触发器尝试以下方法。
该设计涉及两种情况:文件的满载:
首次应将文件合并为合并的镶木木材文件。
Get Meta Data Activity -> Take a Binary dataset without any container or file path and use Child items in the activity.
For-Each activity -> Give the child items list to for-each activity and enable the Sequential checkbox.
- Dataflow 1 -> Create a JSON dataset with dataset parameter in the container name and give it as source of the dataflow1. Pass the container name from the for loop to dataset parameter in the activity. Inside dataflow source settings give a wild card file path A/*.json and add your transformations after the source. In the sink give your parquet dataset. Use dataset parameters for the file name of the parquet if needed.
- Dataflow 2 -> Similarly, do the same for folder B and add folder B transformations in the wild card file path, give B/*.json.
- Dataflow 3 -> Similarly, do the same for folder C and add folder C transformations in the wild card file path, give C/*.json.
为增量负载:
在第一个负载后,使用以下管道设计。为文件夹的创建参数和管道中的文件路径,并传递触发参数。现在,使用所有容器创建存储事件触发器,并将
.json
作为文件结束路径。
引用此so答案
了解将触发参数传递给管道参数。 为增量负载创建另一组3个数据流。 获取带有容器的数据集参数的镶木quet数据集,并为您的文件夹提供一个镶木式文件名。将其用作source1和sink1。使用数据集参数创建另一个JSON数据集,用于容器和文件名。将此数据集用作数据流中的源2。使用联合转换
byName
对Source1和Source2都使用。添加与DataFlow中的接收器相同的Source1数据集。
然后遵循以下管道设计。Set variable -> Extract the folder name and store it in a string variable `folder` using this expression from the pipeline parameter split(pipeline().parameters.folder_path,'/')[1].
Switch activity -> Give the `folder` variable to this
- Case `A` -> Give the case name as `A`.
- Dataflow A -> pass the folder name and file name parameters to the dataflow dataset parameters.
- Case `B` -> Give the case name as `B`.
- Dataflow B -> pass the folder name and file name parameters to the dataflow dataset parameters.
- Case `C` -> Give the case name as `C`.
- Dataflow C -> pass the folder name and file name parameters to the dataflow dataset parameters.
如果转换很复杂,那么使用数据映或用于转换的Synapse笔记本是更好的方法。您可以将ADF触发器用于文件上传/修改,并调用数据链钉或Synapse笔记本以传递文件路径。