Running Non-MapReduce Applications

About this task

This example uses a sample MapReduce program named TestReaderWriter.java.

Procedure

  1. Add the following JAR files to your $HADOOP_CLASSPATH environment variable with the following command:
    export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/opt/mapr/hive/hive-<version>/lib/antlr-runtime-3.4.jar:/opt/mapr/hive/hive-<version>/lib/hive-cli-<veresion>-mapr.jar                  
  2. Compile the test program with the following command:
    javac -cp `hadoop classpath`:${HCAT_HOME}/share/hcatalog/hcatalog-core-<version>-mapr.jar TestReaderWriter.java -d <directory>
  3. Create a JAR file with the following command:
    jar -cf hcatrwtest.jar org
  4. Run the job with the following command:
    hadoop jar /root/<username>/hcatalog/hcatrwtest.jar org.apache.hive.catalog.data.TestReaderWriter -libjars $LIB_JARS

Results

The last command should result in a table named mytbl that is populated with data.