![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hive
文章平均质量分 92
hello_zzw
这个作者很懒,什么都没留下…
展开
-
hive自定义函数
hive中的函数有以下三种类型 UDF:一进一出 UDAF:多进一出 UDTF:一进多出在实现自定函数时需要继承以上三个类中的一个,实现如下方法:evaluate。具体类如下所示public class TuoMin extends UDF { public Text evaluate(final Text s) { return new Text(s.toString() + ...原创 2019-04-25 20:17:37 · 220 阅读 · 0 评论 -
hive与hbase整合
只需要在hive的配置文件中加入如下配置即可 <property> <name>hbase.zookeeper.quorum</name> <value>node2,node3,node4</value> </property>通过zookeeper进行hive与hbase之间的通信...原创 2019-05-06 17:37:44 · 116 阅读 · 0 评论 -
beeline连接hiveserver2
在hive服务器端启动hiveserver2(即metastore服务所在的服务器) hiveserver2通过beeline连接有两种连接方式1.beeline -u jdbc:hive2://localhost:10000/default -n root2.beeline !connect jdbc:hive2://node3:10000/default在beeline进行连...原创 2019-04-24 23:17:43 · 5118 阅读 · 0 评论 -
hive执行sql时死机
在执行MR时,一直暂停,无法执行,如下:hive> select count(*) from person_basic;WARNING: Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engin...原创 2019-04-29 09:18:06 · 1002 阅读 · 4 评论 -
Hive Runtime Error while processing row {"id":202,"name":"zhangsan202","age":18}
在查询数据时,查询的字段,由于和要插入的表的字段不对应,因此报了以下错误:Error: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row {"id":202,"name":"zhangsan202","age":...原创 2019-04-29 09:06:32 · 2622 阅读 · 2 评论 -
Schema initialization FAILED! Metastore state would be inconsistent !!
[root@node3 hive-2.3.4]# schematool -dbType mysql -initSchemaSLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/opt/hive-2.3.4/lib/log4j-slf4j-impl-2.6.2.jar!/org/...原创 2019-04-29 08:58:47 · 18504 阅读 · 18 评论 -
hive安装部署
hive有以下三种搭建模式本地模式derby使用derby存储时,会在当前目录生成一个derby.log文件和一个metastore_db目录。在同一个目录下同时只能有一个用户访问,在更换目录后,会因为没有以上两个文件,导致无法连接之前的数据库。单机模式该模式下需要启动一个服务器,我使用的是mysql服务器配置如下 <!-- hdfs存储路径 --> &...原创 2019-04-23 20:53:50 · 121 阅读 · 0 评论 -
hive --service metastore异常
hive --service metastore启动元数据服务时报一下错误MetaException(message:Version information not found in metastore. ) at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:8...原创 2019-04-23 20:07:45 · 4400 阅读 · 5 评论 -
Hive SQL
1.数据类型data_type : primitive_type | array_type | map_type | struct_type | union_type -- (Note: Available in Hive 0.7.0 and later)## 基本数据类型 ## primitive_type : TINYINT | SMALLINT | I...原创 2019-04-25 21:38:17 · 91 阅读 · 0 评论 -
Hive jdbc运行方式
1.在服务器端启动hiveserver2,metastore服务所在的服务器hive --service hiveserver22.代码和访问mysql数据库的一样package com.bjsxt.hive;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;imp...原创 2019-04-25 20:38:58 · 349 阅读 · 0 评论 -
org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException: Database 'traffic' not found;
spark向hive中写入数据时,提示找不到已经创建完成的数据库,org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException: Database 'traffic' not found;我的问题出现原因:没有为spark设置hive的路径解决方案:将hive客户端的hive-site.xml放入到spark的conf目...原创 2019-07-15 10:09:23 · 5602 阅读 · 2 评论