Search code examples
hadoophiveclouderaebcdichive-serde

How to integrate the java code written on local machine to Serde for hive query


I have written code (java) for the conversion of EBCDIC to ASCII on the local machine. And we are writing a serde for hive query which would provide the ability for Hive to read the EBCDIC file and convert it into ASCII file at run time. So that's why we are writing a SerDe. So how to integrate this code on. Local machine to SerDe.


Solution

  • how to integrate this code on. Local machine to SerDe ?

    Your class must implement org.apache.hadoop.hive.serde2.SerDe then you need to build the jar and move it cluster

    • Now include the JAR in ADD JAR <jar/location/in/cluster>
    • Use class SerDe class in TABLE CREATION or ALTERING like below

      ROW FORMAT SERDE 'classpath.of.implemented.SerDe.in.jar'

    how-to-use-a-serde-in-apache-hive