![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hive
17245
喜欢编程
展开
-
Hive中用户自定义函数UDF UDTF UDAF
概述 Hive 自带了一些函数,比如:max/min 等,但是数量有限,当 Hive 提供的内置函数无法满足你的业务处理需要时,此时就可以考虑使用用户自定义函数(UDF:user-defined function)根据用户自定义函数类别分为以下三种: UDF(User-Defined-Function) 一进一出 UDAF(User-Defined Aggregation Function) 聚集函数,多进一出 类似于:count/max/min UDTF...原创 2020-05-18 19:23:26 · 1219 阅读 · 0 评论 -
Java通过JDBC连接Hive并进行操作
1.工程需要的maven依赖 注意:hive的依赖包的版本需要hive中间件中的lib下对应的hive包的版本一致,否则可能会有版本兼容问题。<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:sch..原创 2020-05-16 09:52:43 · 9494 阅读 · 0 评论 -
Hive DML 数据库定义,表定义等操作
数据导入向表中装载数据1.语法load data [local] inpath '/opt/module/datas/student.txt' [overwrite] | into table student [partition (partcol1=val1,…)];(1)load data:表示加载数据(2)local:表示从本地加载数据到 hive 表;否则从 HDFS 加...原创 2020-05-03 17:21:45 · 147 阅读 · 0 评论 -
hive~分区表和数据关联的三种方式
把数据直接上传到分区目录上,让分区表和数据产生关联的三种方式test_partitions 表创建:create table test_partitions(name string)partitioned by (month string, day string)row format delimited fields terminated by '\t';方式一:上传数据后修复...原创 2020-05-03 16:07:39 · 1425 阅读 · 0 评论 -
Hive~库表操作DDL
1.库DDL创建库create database test;create database if not exists test;create database if not exists test location '/hive'; # 自定义存储目录查询库show databases;库详情信息desc database test;desc database...原创 2020-05-03 13:12:18 · 378 阅读 · 0 评论 -
Hive~文件导入hive
1.创建表指定分隔符为tabcreate table stu(id int, name string) row format delimited fields terminated by '\t';2.创建文件(分隔符为tab)touch stuvim stu11 姓名1112 姓名1213 姓名1314 姓名143.导入文件方式一:通过hive加载本地文件:...原创 2020-05-01 17:22:44 · 684 阅读 · 0 评论 -
hive安装
安装时注意: hive只需要在hadoop的namenode节点中安装即可,hive运行JRE,Hadoop,默认将元数据存储在derby中,但是常见是将数据存储在mysql中的,因此也需要安装mysql数据库安装步骤1.上传安装文件并解压2.配置环境变量vim /etc/profile export HIVE_HOME=/usr/local/hive-2....原创 2020-05-01 16:23:09 · 952 阅读 · 0 评论