- 博客(48)
- 收藏
- 关注
原创 sql上个月月初
上个月月初SELECT TRUNC(ADD_MONTHS(TO_DATE(‘20220117’,‘YYYYMMDD’),-1),‘MM’) FROM DUAL;SELECT ADD_MONTHS (TRUNC(TO_DATE(‘20220331’,‘YYYYMMDD’),‘MM’),-1) FROM DUAL;
2022-01-17 10:25:47
738
原创 BLOB(二进制)与varchar2的转换
BLOB(二进制)数据类型转换为varchar2类型select utl_raw.cast_to_varchar2(dbms_lob.substr(FORMULA))from SMARTREPORT.SYS_TABLE_COLS_CK_RULE;varchar2类型转换为BLOB(二进制)数据类型UPDATE SMARTREPORT.SYS_TABLE_COLS_CK_RULE SET FORMULA=TO_BLOB(UTL_RAW.CAST_TO_RAW(REPLACE( utl_raw.
2021-07-01 09:41:30
2331
原创 insert into插入数据的时候出现不兼容的错误incompatible 不兼容,compatible
插入数据的时候出现问题,两个不同的字段告诉你不兼容原因是字段的位置变化了重新变化一下位置重新插入
2020-08-06 17:03:42
464
原创 hive,mysqp增删改查表名列名
–修改列名ALTER TABLE name CHANGE column_name new_name new_type;–修改表名alter table test rename test1;–添加表列alter table test add column name varchar(10);–删除表列alter table test drop column name;
2020-07-31 15:14:27
118
原创 虚拟机安装达芬奇(可视化)
一、环境准备JDK 1.8(或更高版本)MySql5.5(或更高版本)Mail ServerPhantomJs(安装请参考:phantomjs.org)Redis(可选)二、配置部署初始化目录,将下载好的 Davinci 包(Release 包,不是 Source 包)解压到某个系统目录,如:~/app/davincicd ~/app/davinciunzip davinci-assembly_3.0.1-0.3.0-SNAPSHOT-dist.zip解压后目录结构如下图所示:
2020-07-28 17:00:22
840
原创 sqoop抽取数据从11509->2条数据少了很多
xxxid数据类型是bigintbigin改成数据类型为string,其为主键数据中有’,'默认是一条数据//(抽取的数据少了好多11159->2)sudo sqoop import –connect “jdbc:sap://10.5.125.211:30041” –driver com.sap.db.jdbc.Driver –username “RFCHADOOP00” –password “0ADyrGrte&0D” –query "select * from “_S
2020-07-23 19:02:24
237
原创 No java type for SQL type 2011 for column text
文本(n:1)(数据类型有问题)测试解决成功找到有问题的列进行类型转换–query "select ordertextid,appid,orderid,texttypecode,texttypedesc,**cast(text as varchar) as text,**orderno,creatorid,creator,createtime,editorid,editor,edittime,remark,isdelete,yearmonth from “_SYS_BIC”.“SINOPEC.EDW.03
2020-07-21 09:16:15
458
原创 Error while importing sbt project:
Error while importing sbt project:List([info] Loading global plugins from C:\Users\dell.sbt\1.0\plugins[info] Loading project definition from D:\Users\dell\IdeaProjects\event-hive-ml\project[info] ...
2020-03-25 18:24:33
1476
原创 com.it21learning.kafka.streaming.WordCount
#############################package com.it21learning.kafka.streaming;import org.apache.kafka.clients.consumer.ConsumerConfig;import org.apache.kafka.common.serialization.Serdes;import org.apache....
2020-03-03 16:43:17
106
原创 读文件放到kafka
package com.pb;import com.pb.common.Executable;import org.apache.kafka.clients.producer.KafkaProducer;import org.apache.kafka.clients.producer.Producer;import org.apache.kafka.clients.producer.Pr...
2020-02-25 23:35:49
241
原创 java读配置文件
package com.pb;import java.io.IOException;import java.io.InputStream;import java.util.Properties;public class ReadUtil {static Properties prop=new Properties();static {InputStream in =Thread.c...
2020-02-25 23:30:42
138
1
原创 安装mysql
使用yum 安装:官网链接地址:https://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html安装mysql的yum源:wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpmyum localinstall mysq...
2020-02-01 09:40:21
73
原创 设置免秘钥登录
ssh two 输入密码,exitcd .sshssh-keygen -t rsa四下回车其他机子本机和0.0.0.0ssh-copy-id twossh-copy-id threessh-copy-id fourssh-copy-id onessh-copy-id localhost
2020-01-30 13:21:05
82
原创 去重
select distinct loc from employee lateral view explode(work_place)a as loc;
2020-01-15 13:46:53
82
原创 行转列
select * from employee lateral view explode(work_place) a as loc;表名为employees,explode是函数把数组拆分,work_place是字段,loc是新的字段名,lateral view是侧视图
2020-01-15 13:44:05
46
原创 hive连接belline
hive --service metastore &beeline!connect jdbc:hive2://localhost:10000
2019-12-26 18:34:50
526
原创 oozie运行任务
oozie job --oozie http://sandbox-hdp.hortonworks.com:11000/oozie --config ./job.properties -run
2019-12-26 14:17:15
226
原创 maven阿里镜像下载jar包快
alimaven central aliyun maven http://maven.aliyun.com/nexus/content/repositories/central/ alimaven aliyun ma...
2019-12-19 15:11:32
538
原创 读取topic,查看有哪些topic,删除topic,创建topic生产者
kafka-console-consumer --bootstrap-server localhost:9092 --topic three --from-beginningkafka-topics --list --zookeeper localhost:2181
2019-12-13 09:33:10
1680
原创 sqlyog过期
win+R 输入regedit 运行,打开注册表将此文件删除,重启SQLyog即可如果链接不上可能是没有授权,进入虚拟机,进入mysqlmysql -uroot -pmypassword授权GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘12345’ WITH GRANT OPTION刷新flush privileges;...
2019-12-12 19:58:01
247
原创 mysql远程登陆授权
GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;flush privileges;
2019-12-12 17:21:50
52
原创 hive侧视图
select * from wc;>select loc,count(loc) from wc lateral view explode(split(word,’ ')) a as loc;
2019-12-11 19:00:21
290
原创 hive-查询速度快-orc表-建立格式
create external table if not exists orders_orc(id int,goods_id int,goods_type int,goods_number int,order_number string,account_id int,from int,deleted boolean,status int,payment int,pay_tim...
2019-12-10 16:56:26
465
原创 hive查询数据送到hbase
hbase shell新建Hbase表create ‘account_month’,‘result’2hive设置hiveset hive.server2.tez.initialize.default.sessions=true;新建hive’外部表到hbase的映射create external table if not exists hbase_account_mon...
2019-12-10 15:23:32
110
原创 case when then else end
with a as(select casewhen grand_total<1000 THEN ‘0-1000’when grand_total BETWEEN 1000 AND 5000 THEN ‘1000-5000’else ‘>5000’ end as grandfrom orders)select grand,count(*) cun from a group ...
2019-12-06 17:27:13
56
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人