[英]How to send a .csv file from Local Machine(Getfile) to Hive(Puthiveql) in Apache Nifi using CURL?
我想使用CURL将.csv文件或mysql表从本地计算机(GetFile)发送到Apache Nifi中的Hive(PutHiveql),请告诉我是否有任何命令使用Curl。
The question doesn't make sense as formed. 这个问题从形式上讲是没有道理的。 If you want to ingest the content of a CSV file into Apache NiFi, route and transform it, and eventually write it to a Hive table, your flow would be as follows: 如果要将CSV文件的内容吸收到Apache NiFi中,进行路由和转换,最后将其写入Hive表,则流程如下:
GetFile -> ConvertRecord (CSVReader to AvroRecordSetWriter) -> [Optional processors] -> PutHiveStreaming
PutHiveStreaming
expects the incoming flowfile content to be in Avro format, so the ConvertRecord
processor will translate the ingested data into the correct syntax. PutHiveStreaming
期望传入的流文件内容为Avro格式,因此ConvertRecord
处理器会将摄取的数据转换为正确的语法。
I am unsure of how cURL
fits into this question at all. 我完全不确定cURL
如何适合这个问题。 NiFi does provide the InvokeHTTP
processor to allow arbitrary outgoing HTTP requests, as well as the ExecuteStreamCommand
processor to invoke arbitrary command-line activity, including cURL
. NiFi确实提供了InvokeHTTP
处理器以允许任意传出的HTTP请求,还提供ExecuteStreamCommand
处理器以调用任意命令行活动,包括cURL
。 I don't know why you would need to invoke either in this flow. 我不知道您为什么需要在此流程中调用任何一个。 If you are asking how you could trigger the entire flow via an external cURL
command, NiFi provides both ListenHTTP
and HandleHTTPRequest
processors which start local web servers and listen for incoming HTTP requests. 如果您询问如何通过外部cURL
命令触发整个流程,NiFi会提供ListenHTTP
和HandleHTTPRequest
处理器,它们启动本地Web服务器并侦听传入的HTTP请求。 You can connect these processors to a pair of Wait
/ Notify
processors to control the flow of the ingested file data, as GetFile
is a source processor, and does not allow incoming flowfiles to trigger it. 您可以将这些处理器连接到一对“ Wait
/ Notify
处理器,以控制摄取的文件数据的流,因为GetFile
是源处理器,并且不允许传入的流文件触发它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.