What is a UDF?
💡 Model Answer
UDF stands for User-Defined Function. It is a function created by a user to extend the capabilities of a database or programming environment. In SQL, a UDF can be scalar (returning a single value) or table-valued (returning a set of rows). It allows encapsulation of reusable logic, such as custom calculations or data transformations. In data processing frameworks like Spark, a UDF lets you apply custom logic to DataFrame columns. Example: In PostgreSQL, you might create a UDF to calculate a person's age from a birthdate column. UDFs improve code readability and maintainability by abstracting complex operations.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.
Get Assisting AI — Starts at ₹500