I wanted to understand the UDF WeekOfYear and how it starts the first week. I had to artifically hit a table and run the query . I wanted to not hit the table and compute the values. Secondly can I look at the UDF source code?
SELECT weekofyear
('12-31-2013')
from a;
You do not need table to test UDF since Hive 0.13.0.
See this Jira: HIVE-178 SELECT without FROM should assume a one-row table with no columns
Test:
Result:
The source code (master branch) is here: UDFWeekOfYear.java