【问题标题】:SLF4J : Class path contains multiple SLF4J bindings on azure hdinsightSLF4J:类路径在 azure hdinsight 上包含多个 SLF4J 绑定
【发布时间】:2016-08-02 07:49:11
【问题描述】:

我已经创建了一个 hive 外部表来访问 hbase 表,按照这个HBase-Hive Integration answer

下面是我创建外部表的 hive 查询:

CREATE EXTERNAL TABLE hive_tweets_by_message_words_key(key INT,d STRING) 
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' 
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,d:d") 
TBLPROPERTIES("hbase.table.name" = "tweets_by_message_words_key");

但是当我使用选择查询访问表时,它什么也不返回,我在作业日志中发现如下 azure hdinsight 中提到的

Logging initialized using configuration in file:/C:/apps/dist/hive-0.13.0.2.1.15.1-1234/conf/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/apps/dist/hadoop-2.4.0.2.1.15.1-1234/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/apps/dist/hbase-0.98.0.2.1.15.1-1234-hadoop2/lib/slf4j-log4j12-1.6.4.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.slf4j.impl.Log4jLoggerFactory]
OK
Time taken: 2.032 seconds

【问题讨论】:

    标签: azure hadoop hive hbase azure-hdinsight


    【解决方案1】:

    SLF4J site 中解释了多个 SLF4J 绑定。但是,您看到的日志记录并不能解释为什么查询无法返回结果,因为:

    SLF4J 发出的警告就是这样,一个警告。即使存在多个绑定,SLF4J 也会选择一个日志框架/实现并与之绑定。

    【讨论】:

      【解决方案2】:

      SLF4J 在这里不是问题。由于 HIVE 和 Hadoop 都有 slf4j jars 但版本不同。这会导致警告消息,但 HIVE 最终会选择其中一个。

      从最后两行开始,

      好的

      耗时:2.032 秒

      这意味着您的表已成功创建。你能粘贴你的选择查询吗?您也可以通过 HBase shell 检查 HBase,看看那里是否有一个名为“tweets_by_message_words_key”的表。

      【讨论】:

        猜你喜欢
        • 2012-12-11
        • 2016-03-12
        • 2014-05-18
        • 2021-05-19
        • 2020-07-07
        • 2018-12-12
        • 2012-09-11
        • 2018-07-29
        相关资源
        最近更新 更多