简体   繁体   English

如何使用CURL在Apache Nifi中将.csv文件从本地计算机(Getfile)发送到Hive(Puthiveql)?

[英]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会提供ListenHTTPHandleHTTPRequest处理器,它们启动本地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.

相关问题 将CSV文件从mysql导出到本地计算机 - Export a csv file from mysql to a local machine 将CSV文件从MySQL导出到本地计算机(OS X) - Export a CSV file from MySQL to a local machine (OS X) 如何使用加载数据本地infile从迁移中将csv文件加载到rails中? - how do i load a csv file in rails from a migrate using load data local infile? 如何从 csv 平面文件在 Apache 超集中创建新数据库? - How to create a new database in Apache Superset from a csv flat file? Apache Windows 机器上的 NiFi 无法连接到同一主机上的 MySQL 数据库 - Apache NiFi on Windows machine failed to connect to MySQL database on same host 我如何忽略分号; 在&中,当我从.csv文件创建Hive表时 - How can I ignore the semicolon ; in the & when I am creating a Hive table from a .csv file 如何从存储在本地计算机中的 javascript 文件查询存储在本地主机服务器中的 php 文件? - How to query a php file stored in localhost server from a javascript file stored in local machine? 如何从本地机器访问EngineYard数据库? - How to access EngineYard database from local machine? 如何在不使用sqoop的情况下将数据从mysql本地导入到Hive(University)? - How do I import data from mysql local to Hive(University) without using sqoop? 如何从本地机器mysqldump远程数据库 - how to mysqldump remote db from local machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM