Integration / Apache NiFi Interview Questions
What is the PutDatabaseRecord processor and how does it differ from ExecuteSQL?
PutDatabaseRecord writes structured records from a FlowFile into a relational database table using JDBC. It is the write counterpart to QueryDatabaseTable and ExecuteSQL. Unlike ExecuteSQL — which executes arbitrary SQL statements — PutDatabaseRecord works with the NiFi record model: it reads records from the FlowFile using a RecordReader and generates INSERT, UPSERT, INSERT_IGNORE, UPDATE, or DELETE statements automatically based on the target table schema.
Key configuration properties:
Record Reader: Parses the FlowFile content (JsonTreeReader, CSVReader, AvroReader, etc.).
Statement Type: INSERT, UPDATE, INSERT_OR_UPDATE (upsert), INSERT_IGNORE (ignore on key conflict), DELETE, or USE_ATTR_TYPE (pick from a FlowFile attribute).
Database Connection Pooling Service: A DBCPConnectionPool reference.
Table Name: Static name or EL expression like ${target.table}.
Translate Field Names: When enabled, converts record field names (e.g., camelCase) to database column name conventions (e.g., snake_case).
The advantage over ExecuteSQL for writes is that PutDatabaseRecord handles schema mapping automatically — it queries the target table's metadata to determine column types and order, then generates correct parameterized SQL. This avoids hand-crafting INSERT statements and handles type coercion automatically.
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...
