hive -e/Hive -f 出现WARN问题

hive -e 是执行指定SQL,-f 是执行指定HQL文件。

hive -e / -f 会出现WRN:

WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.

问题:

因为CDH上弃用了Hive Cli,但因为一些企业任在使用,他们使用Cli连接其他程序容易出错,所以会警告提示。

只在Cli上查询是不会有WARN的,但如果将Cli的结果跟其他程序连接时,就会出现这样情况。

原因是CDH上运行的Hive加载了Spark的jar包到它的CLASSPATH下:

# add Spark assembly jar to the classpath
if [[ -n "$SPARK_HOME" && !("$HIVE_SKIP_SPARK_ASSEMBLY" = "true") ]]
then
    sparkAssemblyPath=`ls ${SPARK_HOME}/lib/spark-assembly-*.jar`
    CLASSPATH="${CLASSPATH}:${sparkAssemblyPath}"
fi

有时需要重定向输出结果时,文件末尾会带这两个WARN,对数据处理不太友好

[root@hadoop3 conf]# /export/servers/hive-3.1.3/bin/beeline -u jdbc:hive2://hadoop1:10000 -n root -p SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/export/servers/hive-3.1.3/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/export/servers/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/export/servers/hive-3.1.3/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/export/servers/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Connecting to jdbc:hive2://hadoop1:10000/;user=root Enter password for jdbc:hive2://hadoop1:10000/: ********* 25/03/08 21:18:03 [main]: WARN jdbc.HiveConnection: Failed to connect to hadoop1:10000 Could not open connection to the HS2 server. Please check the server URI and if the URI is correct, then ask the administrator to check the server status. Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop1:10000/;user=root: java.net.ConnectException: 拒绝连接 (Connection refused) (state=08S01,code=0) Beeline version 3.1.3 by Apache H怎么回事
03-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

訾零

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值