Integration / Apache NiFi Interview Questions
What is the PartitionRecord processor and what is a common use case?
PartitionRecord is a record-aware NiFi processor that reads records from an input FlowFile and groups them into separate output FlowFiles based on one or more field values. All records sharing the same value for the partition field(s) go to the same output FlowFile; records with different values produce different FlowFiles.
For example, if you have a FlowFile containing 10,000 records with a country field, PartitionRecord produces one FlowFile per distinct country value. Each output FlowFile's country attribute is set to the partition value it contains.
The partitioning key is expressed using NiFi RecordPath syntax: /country for a top-level field, /address/state for a nested field, /tags[0] for an array element. Multiple partition keys can be added as separate User-Defined Properties, producing compound partitions.
Common use cases:
- Routing records to different Kafka topics by type: Partition by
/event.type, then UpdateAttribute setskafka.topicfrom the partition attribute, enabling PublishKafka to route each FlowFile to its appropriate topic. - Partitioned file writes to object storage: Partition by
/dateand/regionto write into Hive-compatible partition paths in S3 (e.g.,dt=2024-01-15/region=us-east/data.parquet). - Database routing: Partition by customer ID to route records to different database shards.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
