|ss.date_time from ${MyConfigSession.VIEW_SESSION_NO_MATCH} AS ss
|left join (select distinct id,mobile_phone from pica_ds.pica_doctor where pica_doctor.delete_flag = 1 ) AS b on ss.mobile = b.mobile_phone
|left join (select distinct id,mobile_phone from pica_ds.pica_doctor where pica_doctor.delete_flag = 1 and mobile_phone!='' and mobile_phone!='XK0HdMN6dAfOlYPOFHHL0A==' ) AS b on ss.mobile = b.mobile_phone
""".stripMargin
finalvalMOBILE_PHONE_SQL_PREF:String=
s"""
...
...
@@ -125,8 +134,9 @@ object MyConfigSession {
finalvalEQUIPMENT_INFO_SQL:String=
"""
|SELECT a.user_id,a.device_token ,ROW_NUMBER() OVER ( PARTITION BY a.device_token ORDER BY a.creat_time DESC ) row_d
|from pica_ds.picams_equipment_info AS a
| where a.user_id IS NOT NULL
|from (select e1.user_id,e1.device_token,e1.creat_time,e1.modify_time,e1.delete_flag from pica_ds.picams_equipment_info e1 union
| select e2.user_id,e2.device_token,e2.creat_time, e2.modify_time,e2.delete_flag from pica_ds.picams_p_equipment_info_shadow e2 ) a
| where a.user_id IS NOT NULL and a.user_id>0 and a.delete_flag=1 and device_token is not null
| AND (to_date(a.creat_time) = date_sub(current_date(),1) OR to_date(a.modify_time) = date_sub(current_date(),1))
valfields=List("pseudo_session","user_id","COALESCE(cast(user_id as int),0) user_id_int","mobile","device_token","user_token","view_class","view_path","action","action_type",
valloadDataSql=s"${insertSql} table ${MyConfigSession.HIVE_TABLE0} partition(created_day='${partitionDay}') select ${fields.mkString(",")} from ${tmpTable} distribute by rand()"
valloadDataSql=s"${insertSql} table ${MyConfigSession.HIVE_TABLE0} partition(created_day='${partitionDay}') select concat(regexp_replace( '${partitionDay}','-','') ,cast( (row_number() over(partition by 1 order by created_time) +${count}) as string)) as id,"+
s"${fields.mkString(",")} from ${tmpTable} distribute by rand()"
sparkSession.sql(loadDataSql)
}
}
...
...
@@ -271,8 +265,8 @@ case class SessionPref(pseudo_session: String,