9:00~11:00
Hive概述
在大数据中可以用java,python等语言进行数据统计分析也可以用sql来数据统计,sql明显更好一些,其中map reduce只支持程序开发。如果要用sql的话,hive应运而生
hive是分布式计算工具,底层代码基于map reduce,主要功能是把sql语句翻译成map reduce程序运行
如何把sql翻译成map reduce程序呢
SELECT city FROM user
其中user这个是表,数据的文件会在哪里?文件中的分隔符是什么?怎么判断哪一列是city?city是什么类型数据?
我们需要将文件映射成一张表,这就是元数据管理,即数据位置,数据结构,对数据进行描述 进行记录。
有了记录以后,我们还需要一个将sql转换成map reduce的功能,即sql解析器
希望它能做到
sql分析 sql到map reduce程序的转换 提交程序运行并收集执行结果
hive基础架构
部署了一下午的hive
出现报错
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.3-bin/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.4/share/hadoop/common/lib/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See SLF4J Error Codes for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL: jdbc:mysql://localhost:3306/hive?
createDatabaseIfNotExist=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
Metastore Connection Driver : com.mysql.cj.jdbc.Driver
Metastore connection User: root
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
Underlying cause: java.sql.SQLException : No suitable driver found for jdbc:mysql://localhost:3306/hive?
createDatabaseIfNotExist=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
问题一:hadoop和hive之间guava的版本差异
解决方法 换成同样的版本
问题二:sql驱动未找到
解决方法:换一个版本的sql驱动jar包以及链接地址别写错了
问题三:检查配置中连接地址是否错误