Calling the UDF in a query
After registration of a UDF, you do not need to restart Hive before using the UDF in a query. In this example, you call the UDF you created in a SELECT statement, and Hive returns the data type of a column you specify.
- For the example query in this task, you need to create a table in Hive
and insert some data.This task assumes you have the following example table in Hive:
+------------------+---------------+---------------+ | students.name | students.age | students.gpa | +------------------+---------------+---------------+ | fred flintstone | 35 | 1.28 | | barney rubble | 32 | 2.32 | +------------------+---------------+---------------+
- As a user, you need to have permission to call a UDF, which a Ranger policy can provide.