hive命令行抛NullPointerException

我只是执行了一下这个代码

create temporary function strip as 'com.fatkun.Strip';

就抛出异常

hive> create temporary function strip as 'com.fatkun.Strip';
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.main(CliDriver.java:516)
	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)

从代码中看CliDriver.java:221,
原来和print header有关系。。。囧之前是为了打印header
默认这个是false的,所以把它去掉或者在hive-site置为false即可

<property>
  <name>hive.cli.print.header</name>
  <value>false</value>
</property>
updatedupdated2024-08-302024-08-30