– 存储过程转hql
1、将存储过程中的create or replace procedure proname as 删除
2、讲存储过程中的变量名删除
3、将存储过程中的BEGIN 、 END 、commit 关键字删除
4、将存储过程中EXECUTE IMMEDIATE V_SQL;删除
5、将存储过程中 dbms_output.put_line()语句删除
6、存储过程中的 先truncate 在insert 在hive中直接insert overwrite
7、存储过程中的插入 insert into tablename;hive中 insert into table tablename;
8、注意hive中表名前加上层级:DWD.\DIM. …
9、hql中的insert 不需要指定列名,直接插入即可,注意后边select的顺序
10、存储过程中decode(asstype,105088,1,2) ->case when asstype=105088 then 1 when asstype is null then asstype else 2 end
11、存储过程 billid desc hql-> coalesce(billid,1)desc
12、存储过程 create global temporary table TEMP_DWD_EAM_BIZ_LIFE_2 -> HQL :create temporary table TEMP_DWD_EAM_BIZ_LIFE_2
13、字段数据类型 对应问题
14、存储过程中的’’ 99991231’’ --》hql ’ 99991231’
15、截取日期: hive中常用substr(t1.data_stcs_dt,7,2):截取日;
16、拼接函数concat:concat(2020,09)、concat_ws(‘-’,2020,09):2020-09;
17、hive中的替换函数:regexp_replace(cast(T3.FSRT_BIZ_DT as string),‘-’,‘’)
存储过程转hql
最新推荐文章于 2022-07-29 12:32:59 发布