1. Download hive source with SVN
Store the source code in the Hive_trunk directory.
# SVN Co HTTP://SVN.APACHE.ORG/REPOS/ASF/HIVE/TRUNK/HIVE_TRUNK1
2. Build Eclipse Project
Under the Hive_trunk1 directory, execute the ant eclipse-files command
#ant Eclipse-files
Generate a. Project project file that can be imported
3 Load Hive_trunk1 project.
Open the Eclipse development environment, File->import. Open the Import dialog box and select root directory as the Hive_trunk1 directory.
You can see in the Project Explorer window that you have been imported successfully.
Continue to execute the Ant Package command in the Hive_trunk directory
#ant Package
It took me 22 minutes to spend a lot of time.
You'll find a lot of jar packs in the new build/opt/hive_trunk1/build/dist/lib directory.
Hive_trunk items, menu run-> Debug Configurations dialog box, double-click Java application to do the definition shown in the following illustration.
Click to enter the Classpath tab, for the Classpath tab, you need
Click the "Add External JARs" button to add all the jar packages under "Hadoop-0.20.0-core.jar", "Hive_trunk1/build/dist/lib" to classpath.
Next click on the "Advanced" button to add the Hive hive_trunk1/build/dist/conf directory
On the project right key-->properties
Select Builders and remove the √ in front of the Java Builder
Click the New button and double-click Ant Builder to choose Ant's compilation mode
The name of the place is written on Hive_ant_builder
Click "Browser File System" in BuildFile and browse to set to/hive_trunk1/build.xml
Open the Targets tab and click the Set Targets button on the manual build to do the following diagram configuration.
Click Apply to apply Configuration
Click the OK button to move the Hive_ant_builder up
Add in hive_trunk1/build/dist/conf directory
Hive-site.xml.
Hive-site.xml is a copy of the hive-default.xml.template that is copied and renamed
To make some changes to the hive-site.xml, here are three ways to configure the hive metabase, the default embedded Derby database, the network mode Derby database, and the MySQL database.
<configuration> <property> <name>javax.jdo.option.ConnectionURL</name> <!--<value >jdbc:derby:;d atabasename=metastore_db;create=true</value>--> <!--<value>jdbc:derby:// Localhost:1527/db_hive;create=true</value>--> <value>jdbc:mysql://192.168.251.19:3306/mydb_hive? useunicode=true& characterencoding=utf-8&createdatabaseifnotexist=true</value> <description> JDBC connect string for a jdbc metastore</description> </property> <property> <name>javax.jdo.o Ption. connectiondrivername</name> <!--<value>org.apache.derby.jdbc.EmbeddedDriver</value>--> & lt;! --<value>org.apache.derby.jdbc.ClientDriver</value>--> <value>com.mysql.jdbc.driver</ Value> <description>driver class name for a JDBC metastore</description> </property> <property > <name>javax.jdo.option.connectionusername</namE> <value>mysql</value> <description>username to use against Metastore database</description&
Gt </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value> Mysql</value> <description>password to use against Metastore database</description> </property > </configuration>
I tested all three connection modes, and I chose the MySQL database.
Using the MySQL database also requires that you import MySQL jdbc into classpath.
Use Mysql-connector-java-5.1.24-bin.jar here.
For grid-mode Derby, you need to use the L JDBC Connection package Derbyclient.jar for Derby,
Use of Derby can refer to http://blog.csdn.net/duguduchong/article/details/8689822
4. Debugging Hive
Click Debug Under Menu "Run" to step through the hive.
Before this screenshot I created 3 hive tables, which I found in the console window in the screenshot to prove the correctness of the above configuration process.