Integration / Apache NiFi Interview Questions
What is the difference between EvaluateJsonPath and FlattenJson processors?
EvaluateJsonPath and FlattenJson both work with JSON content but serve fundamentally different purposes.
EvaluateJsonPath extracts specific values from a JSON payload using JSONPath expressions and writes those values either to FlowFile attributes or to the FlowFile content. It is a targeted extraction tool — you specify exactly which fields you want and where they go. Configuration requires one or more User-Defined Properties, each mapping a JSONPath expression to a destination attribute name. The JSON content itself is typically not modified when writing to attributes.
FlattenJson takes a nested JSON object and flattens its entire structure into a single-level key-value object, using configurable separator characters to compose the flattened key names. For example:
Input: {"user": {"address": {"city": "Austin"}}}
Output: {"user.address.city": "Austin"}FlattenJson is used to normalize deeply nested JSON into flat structures suitable for systems that expect flat schemas (relational databases, Elasticsearch, CSV). It operates on the entire document, producing a new content FlowFile with the flattened JSON.
The choice: use EvaluateJsonPath when you need specific field values as attributes for routing or enrichment; use FlattenJson when you need to restructure the entire document hierarchy into a flat representation for downstream storage.
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...
