[英]Azure Data Factory v2 Data Transformation
I am new to Azure Data Factory. 我是Azure Data Factory的新手。 And my question is, I have a requirement to move the data from an on-premise Oracle and on-premise SQL Server to a Blob storage.
我的问题是,我需要将数据从本地Oracle和本地SQL Server移至Blob存储。 The data need to be transformed into JSON format.
数据需要转换为JSON格式。 Each row as one JSON file.
每行作为一个JSON文件。 This will be moved to an Event Hub.
这将被移到事件中心。 How can I achieve this.
我该如何实现。 Any suggestions.
有什么建议么。
The Data copy tool as part of the azure data factory is an option to copy on premises data to azure. 作为天蓝色数据工厂一部分的数据复制工具是将场所数据复制到天蓝色的一种选择。 the data copy tool comes with a configuration wizard where you do all the required steps like configuring the source, sink, integration pipeline etc. In the source you need to write a custom query to fetch data from the tables you require in json format.
数据复制工具随附一个配置向导,您可以在其中执行所有必需的步骤,例如配置源,接收器,集成管道等。在源中,您需要编写一个自定义查询以从json格式的所需表中获取数据。
In case of SQL server to select json you would use the options OPENJSON, FOR JSON AUTO to convert the rows to json. 如果使用SQL Server选择json,则可以使用OPENJSON,FOR JSON AUTO选项将行转换为json。 Supported in SQL 2016. For older versions you need to explore the options available.
SQL 2016支持。对于较旧的版本,您需要探索可用的选项。 Worst case you can write a simple console app in C#/java to fetch the rows and then convert them to json file.
最坏的情况是,您可以用C#/ java编写一个简单的控制台应用程序以获取行,然后将其转换为json文件。 And then you can upload the file to azure blob storage.
然后,您可以将文件上传到Azure Blob存储。 If this is an one time activity this option should work and you may not require a data factory.
如果这是一次活动,则此选项应该起作用,并且您可能不需要数据工厂。
In case of ORACLE you can use the JSON_OBJECT function. 如果是ORACLE,则可以使用JSON_OBJECT函数。
You could use lookup activity + foreach activity. 您可以使用查找活动+ foreach活动。 And inside the foreach, there is a copy activity.
在foreach内部,有一个复制活动。 Please reference this post.
请参考这篇文章。 How to copy СosmosDb docs to Blob storage (each doc in single json file) with Azure Data Factory
如何使用Azure Data Factory将СosmosDb文档复制到Blob存储(单个json文件中的每个文档)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.