Well it seems that simply moving the set header statement after the 'create temporary function' statement works just fine.
---------------------------------------- > From: saurab...@live.com > To: user@hive.apache.org > Subject: 'set cli header' throws null pointer exception > Date: Fri, 1 Jun 2012 14:11:09 -0700 > > > This is a weird issue. I've been setting hive CLI headers for a long time > using the following: > > set hive.cli.print.header=true; > > Recently, I started using custom Hive UDF. Here is my test file, myfunc.sql: > > -- > add jar <myjar>; > create temporary function <myfunc> as <appropriate path>; > <test query 1>; > <test query 2>; > -- > > This works just fine. However, if I add the line hive cli header to the top, > Hive crashes at line 2, i.e. the create temporary function with the following > error: > > -- > Added /home/somejar.jar to class path > Added resource: /home/somejar.jar > OK > Exception in thread "main" java.lang.NullPointerException > at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:221) > at > org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:286) > at > org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:310) > at > org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:317) > at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:490) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.apache.hadoop.util.RunJar.main(RunJar.java:197) > -- > > Any idea what's going on? > > Regards, > Saurabh >