The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

Hive / HCatalog Forum

Adding Hive custom serde jars permanently

  • #58218
    Hari Sekhon
    Participant

    Hive custom jar addition isn’t documented and doesn’t work by default – I know the procedure of adding to hive.aux.jars.path but this doesn’t work in Ambari as it gets overridden by HIVE_AUX_JARS_PATH from hive-env.sh – which itself is not manageable by Ambari (AMBARI-5802) and changes to hive-env.sh get overwritten at each restart. Setting it per session is not an option users would tolerate.

    Also, you have to be careful with hive-env.sh as adding a jar to HIVE_AUX_JARS_PATH causes the /usr/lib/hive-hcatalog/share/hcatalog/hive-hcatalog-core-*.jar to not evaluate properly and breaks Tez pre-run checks:

    Exception in thread “main” java.lang.RuntimeException: java.io.IOException: Previous writer likely failed to write hdfs://nameservice1/tmp/hive-root/_tez_session_dir/f9ecb2b2-c034-43b1-ac11-1e0aac1962b6/hive-hcatalog-core-*.jar. Failing because I am unlikely to write too.
    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:358)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
    Caused by: java.io.IOException: Previous writer likely failed to write hdfs://nameservice1/tmp/hive-root/_tez_session_dir/f9ecb2b2-c034-43b1-ac11-1e0aac1962b6/hive-hcatalog-core-*.jar. Failing because I am unlikely to write too.
    at org.apache.hadoop.hive.ql.exec.tez.DagUtils.localizeResource(DagUtils.java:865)
    at org.apache.hadoop.hive.ql.exec.tez.DagUtils.addTempFiles(DagUtils.java:741)
    at org.apache.hadoop.hive.ql.exec.tez.DagUtils.localizeTempFilesFromConf(DagUtils.java:690)
    at org.apache.hadoop.hive.ql.exec.tez.TezSessionState.open(TezSessionState.java:149)
    at org.apache.hadoop.hive.ql.exec.tez.TezSessionState.open(TezSessionState.java:123)
    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:356)
    … 7 more

    I’ve worked around by editing the hive-env.sh.j2 templates in Ambari server and agent caches for the 2.0.6 stack (which it seems to use even though I’m using HDP 2.1) and pre-evaluating the hcatalog jar to work around above exception:

    export HIVE_AUX_JARS_PATH=$(ls /usr/lib/hive-hcatalog/share/hcatalog/hive-hcatalog-core-*.jar|tr ‘\n’ ‘:’)/path/to/my/custom-serde.jar

    Yes there is no colon between the ) and next jar otherwise it gives :: – ie a blank which results in a “Can not create a Path from an empty string” error.

    A bunch of ugly hacks to get this working. Does anybody have a better way?

    Regards

    Hari Sekhon
    Big Data Specialist Contractor
    http://www.linkedin.com/in/harisekhon

  • Author
    Replies
  • #71335
    Carlos Delgado
    Participant

    Hi,

    Any answers? I know it’s old, but still relevant :)

    Best

    C

The forum ‘Hive / HCatalog’ is closed to new topics and replies.

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.