如何使用 NiFi 获取 Blob 文件? [英] How can I get the Blob file using NiFi?

查看:32
本文介绍了如何使用 NiFi 获取 Blob 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Oracle DB 中有一个表,其中一列保存 BLOB 数据.NiFi 是否支持从 Oracle 到 PostgreSQL 的 Blob 文件?如果是,我需要使用哪些处理器来转换和存储数据?我想在PostgreSQL中查看blob数据的原始内容.

I have a table in Oracle DB with one column holding BLOB data. Does NiFi support Blob file from Oracle to PostgreSQL? if yes, what are the processors do I need to use for convert and store the data? I want to see the original content of the blob data in PostgreSQL.

谢谢.

推荐答案

您可以使用 ExecuteSQL 从 Oracle 中获取 BLOB 数据,但目前您不能使用 ExecuteSQLRecord(由于 this bug)或使用 PutDatabaseRecord 将 BLOB 数据放入 PostgreSQL 中的 bytea 字段(由于这个错误).此外,我不相信 ConvertJSONToSQL 支持 BLOB/CLOB,但我不完全确定.

You can use ExecuteSQL to get the BLOB data out of Oracle, but currently you can't use ExecuteSQLRecord (due to this bug) or use PutDatabaseRecord to put BLOB data into a bytea field in PostgreSQL (due to this bug). Also I don't believe ConvertJSONToSQL has ever supported BLOB/CLOB, but I'm not totally sure.

在此期间,您或许可以使用 ConvertRecord 将 BLOB 转换为字符串并按这种方式放置.如果您不能将字符串值放入 bytea 列,那么也许将其更改为 String 列,然后当您查询 String 列时,您可以将其包装在 decode() 将其改回 bytea.不理想,但可能的解决方法.

In the meantime, you might be able to use ConvertRecord to convert the BLOB to a String and put it in that way. If you can't put a String value into a bytea column, then perhaps change it to a String column, and then when you query the String column you could wrap it in a decode() to change it back to bytea. Not ideal but a possible workaround.

这篇关于如何使用 NiFi 获取 Blob 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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