Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

ConsumeKafka to PuthiveQL can't send data in NiFi Directly

avatar

HDP-2.6.3.0 NIFI 1.60

How to insert data into the hive table from Kafka consumer?

KafkaConsumer ----->PutHiveQL

1 ACCEPTED SOLUTION

avatar
Master Guru
@Hariprasanth Madhavan

PutHiveQL processor is used to:

Executes a HiveQL DDL/DML command (UPDATE, INSERT, e.g.). The content of an incoming FlowFile is expected to be the HiveQL command to execute.

-

If you want to insert data into hive table directly then use PutHiveStreaming processor instead of PutHiveQL.

Puthivestreaming processor expects the incoming data in AVRO format and table needs to Transactional enabled, so based on the KafkaConsumer format of data use ConvertRecord processor to Convert the source data into AVRO format then feed the Avro data into PutHiveStreaming processor.

Flow:

1.ConsumeKafka
2.ConvertRecord //convert the outgoing flowfile into AVRO format
3.PutHiveStreaming

Refer to this link for hive transactional tables and this link for ConvertRecord processor usage.

-

If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.

View solution in original post

1 REPLY 1

avatar
Master Guru
@Hariprasanth Madhavan

PutHiveQL processor is used to:

Executes a HiveQL DDL/DML command (UPDATE, INSERT, e.g.). The content of an incoming FlowFile is expected to be the HiveQL command to execute.

-

If you want to insert data into hive table directly then use PutHiveStreaming processor instead of PutHiveQL.

Puthivestreaming processor expects the incoming data in AVRO format and table needs to Transactional enabled, so based on the KafkaConsumer format of data use ConvertRecord processor to Convert the source data into AVRO format then feed the Avro data into PutHiveStreaming processor.

Flow:

1.ConsumeKafka
2.ConvertRecord //convert the outgoing flowfile into AVRO format
3.PutHiveStreaming

Refer to this link for hive transactional tables and this link for ConvertRecord processor usage.

-

If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.