HIVE
HIVE
xcagy
CAGY官方博客
展开
-
论数据库的中文字段好处
我们先来看一张表设想一下,假如我们把所有字段都改成英文,一定是一场灾难。然后我们在看看过去若干年的评论还有教科书上的规范要求,都是尽量不要用中文字段,以至于老师、同学、同事、都是这么约定俗成的方式。其实时代在进步,既然是允许,既然存在,就有存在的道理之前的问题、或者之前对中文字段的偏见,都是因为一个原因导致的,那就是乱码所以,只要你能控制或者处理乱码的问题,其实可以大胆使用中文字段,特别是这种字段特别多的情况下这时候你...原创 2021-12-30 17:27:56 · 883 阅读 · 0 评论 -
sqoop(hive到pgsql)
hive="/usr/bin/hive"field_segmentation="\001"source_database="postgres"source_username="postgres"source_pwd=""source_ip=""source_port="5432"source_pgsqldb=""external_storage_path="/user/hive/warehouse/文件路径"if [ -n "$1" ] ;then do_day=$1els..原创 2021-11-10 10:30:57 · 1508 阅读 · 6 评论 -
SQOOP(hive抽取到hive)
hive='/usr/bin/hive'hive_database='cagy'if [ -n "$1" ] ;then do_day=$1else do_day=`date -d "-1 day" +%F`fistr_sql="\use $hive_database;with a as (select * from table where dt='2222-22-22')insert overwrite table 被插入的表名字 partition(dt...原创 2021-11-10 10:28:02 · 1812 阅读 · 0 评论 -
用SQOOP抽取Oracle到HIVE
# 定义变量名字hive='/usr/bin/hive'hive_database=''field_segmentation='\001'external_storage_path='/user/hive/warehouse/qi_tcte/ods'source_database=''source_username=''source_pwd=''source_ip=''source_port='1521'# 日期格式为 yy-MM-dd 2020-01-01if [ -n "$1.原创 2021-11-10 10:09:23 · 2013 阅读 · 0 评论 -
Sqoop抽取hive字段错位的解决办法
1.观察是不是设置了分隔符2.select的时候把每一个字段都写出来3.检测原表的字段顺序和目标表的字段顺序是否一致原创 2021-11-01 16:56:25 · 702 阅读 · 0 评论 -
sqoop从oracle抽数脚本
hive='/usr/bin/hive'hive_database='xxxxx'field_segmentation='\001'external_storage_path='/user/hive/warehouse/xxx/odsxxx'source_database='xxx'source_username='xxx'source_pwd='xxxx'source_ip='xxx'source_port='1521'if [ -n "$1" ] ;then do_day=..原创 2021-10-21 15:53:28 · 680 阅读 · 0 评论 -
HIVE分区表插入数据SQL
with a as(select * from xxx)insert overwrite table dwd_oa_col_summary partition(dt='$do_day')select 1,2,3; --查询的值和表字段数量一致就行原创 2021-10-09 09:57:46 · 737 阅读 · 0 评论 -
HIVE简单操作命令
beelinebeeline> !connect jdbc:hive2://192.168.2.2:10000hdfs回车回车直接用默认表,不需要配置权限create table st(id int,name string) row format delimited fields terminated by ",";insert into st(id,name) values(1,'萨达')...原创 2020-08-26 16:14:44 · 100 阅读 · 0 评论 -
web-kettle连接hive的秘籍HDP和CDH
CDH直接去官网下载HiveJDBC4.jar,丢到tomcat的lib目录下即可HDP好像还是要改C:\kettle7.1.0\plugins\pentaho-big-data-plugin\plugin.properties改了就可以连了连不上再想办法原创 2020-08-26 16:06:58 · 293 阅读 · 0 评论 -
HIVE获取大于当天的时间戳
SELECT unix_timestamp(from_unixtime(unix_timestamp(),'yyyy-MM-dd 00:00:00'));获取当天0点开始的时间戳原创 2020-02-20 11:31:13 · 3342 阅读 · 0 评论