如何在IntelliJ IDEA配置Hive 3.1的调试环境
文章目录
Prepare
please install JDK-1.8, Hadoop3.1 and get Hive-3.1 source code first
- JDK
JDK-version=1.8
export JAVA_HOME=/path/to/jdk/home
- Hadoop
hadoop-version=3.1
export HADOOP_HOME=/path/to/hadoop/home
- Hive Source Code
hive-version=3.1
- IntelliJ IDEA
Start Hadoop
cd $HADOOP_HOME
./sbin/start-all.shHive package install
cd /path/to/hive/source
mvn clean package -DskipTests -Phadoop-2 -PdistHive config
only when the last step finished(hive package install)
cd $HIVE_SRC/packaging/target/apache-hive-{version}-bin/apache-hive-{version}-bin/conf
# find HADOOP_HOME in hive-env.sh, replace it to our $HADOOP_HOME
cd $HIVE_SRC/packaging/target/apache-hive-{version}-bin/apache-hive-{version}-bin
# init metadata database(using derby, if you need mysql, you should install mysql first)
bin/schematool -dbType derby -initSchemaHive debug
start hive debug console(listening port 8000 default)
cd $HIVE_SRC/packaging/target/apache-hive-{version}-bin/apache-hive-{version}-bin
bin/hive --debug -hiveconf hive.root.logger=DEBUG,consoleConfig IDEA
- find class CliDriver(entry for hive cli)
- Edit configurations -> add -> choose "remote"

Finally!
We can add break points in idea for debugging, try to input "show databases" in console(which we execute the command "bin/hive --debug -hiveconf hive.root.logger=DEBUG,console")
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论