2019-02-20

tHiveConnection

tJava:自己写代码

tHiveInput

tRowGenerator

tHDFSOutput

tHiveRow

  • 查看文件列表

!sh hdfs dfs -ls -h /apps/hive/warehouse/cn_ods_businessplan.db/o_syn_bdg_hyper_bulk_i

  • hv 连接hive

  • 查看表具体信息

desc formatted cn_ods_businessplan.o_syn_bdg_heper_bulk_i;

  • hive动态分区

"set hive.exec.dynamic.partition.mode=nostrict"

"set hive.compute.query.using.stats=false"

  • syn表写入bas表

"insert overwrite table cn_ods_businessplan.o_bas_bdg_sams_total_d partition (day)

select t1.*,cast(end_date as string) as day from cn_ods_businessplan.o_syn_bdg_sams_total_i t1

"

  • 取当前时间的年

Integer.parseInt(TalendDate.formatDate("yyyy",TalendDate.getCurrentDate()))

  • 取当前时间的月

Integer.parseInt(TalendDate.formatDate("MM",TalendDate.getCurrentDate()))

  • 转换int

Integer.parseInt(StringHandling.RIGHT(cat.cat_nbr,2))+""

*拼接年月成 yyyy-mm-dd

Var.strYear + "-" + StringHandling.RIGHT("0"+Var.strMonth,2) + "-" + StringHandling.RIGHT("0"+da.Days,2)

*换取当前月的天数

Integer.parseInt(TalendDate.formatDate("dd", TalendDate.getLastDayOfMonth(TalendDate.getCurrentDate())))

  • ODS层 syn又存成bas层 文件格式由text...到了orc...,orc对hive速度快

连接essbase

main

day D01

month Per01

你可能感兴趣的:(2019-02-20)