Hive - get_json_object 호출시 에러 


hive에서 hive udf의 json을 사용하려 할 때(get_json_object를 사용, ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'를 사용) 다음 에러가 발생한다. 


Error while compiling statement: FAILED: RuntimeException MetaException(message:java.lang.ClassNotFoundException Class org.openx.data.jsonserde.JsonSerDe not found)
class org.apache.hive.service.cli.HiveSQLException



에러가 발생하지 않고 정상적으로 실행하려면,다음과 같이 실행하면 get_json_object가 실행된다.

$ wget http://www.congiu.net/hive-json-serde/1.3.7/cdh5/json-serde-1.3.7-jar-with-dependencies.jar
$ hive
hive> add jar /위치/json-serde-1.3.7-jar-with-dependencies.jar


세션이 실행될 때마다 동작시키려면 .hiverc를 수정한다.


$ vi ~/.hiverc

..

add jar /위치/json-serde-1.3.7-jar-with-dependencies.jar











Posted by '김용환'
,