hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Hadoop Wiki] Update of "Hive/HiveClient" by BillGraham
Date Thu, 04 Jun 2009 18:50:37 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.

The following page has been changed by BillGraham:
http://wiki.apache.org/hadoop/Hive/HiveClient

------------------------------------------------------------------------------
  # Then on the command-line
  $ javac HiveJdbcClient.java
  
- # To run the program, we need the following jars in the classpath
+ # To run the program in standalone mode, we need the following jars in the classpath
  # from hive/build/dist/lib
- #     commons-logging-*.jar
+ #     hive_exec.jar
  #     hive_jdbc.jar
  #     hive_metastore.jar
- #     hive_serde.jar
  #     hive_service.jar
  #     libfb303.jar
- #     libthrift.jar
+ #     log4j-1.2.15.jar
  #
  # from hadoop/build
  #     hadoop-*-core.jar
+ #
+ # To run the program in embedded mode, we need the following additional jars in the classpath
+ # from hive/build/dist/lib
+ #     antlr-runtime-3.0.1.jar
+ #     derby.jar
+ #     jdo2-api-2.1.jar
+ #     jpox-core-1.2.2.jar
+ #     jpox-rdbms-1.2.2.jar
+ #
+ # as well as hive/build/dist/conf
  
  $ java -cp $CLASSPATH HiveJdbcClient
+ 
+ # Alternatively, you can run the following bash script, which will seed the data file
+ # and build your classpath before invoking the client.
+ 
+ #!/bin/bash
+ HADOOP_HOME=/your/path/to/hadoop
+ HIVE_HOME=/your/path/to/hive
+ 
+ echo -e '1\x01foo' > /tmp/a.txt
+ echo -e '2\x01bar' >> /tmp/a.txt
+ 
+ HADOOP_CORE=`ls $HADOOP_HOME/hadoop-*-core.jar`
+ CLASSPATH=.:$HADOOP_CORE:$HIVE_HOME/conf
+ 
+ for i in ${HIVE_HOME}/lib/*.jar ; do
+     CLASSPATH=$CLASSPATH:$i
+ done
+ 
+ java -cp $CLASSPATH HiveJdbcClient
  
  }}}
  

Mime
View raw message