Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
L
label
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
zhenxin.ma
label
提交
7dec4501
提交
7dec4501
编写于
10月 16, 2020
作者:
wuyunfeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改session_path计算逻辑
上级
e17e1ffe
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
7 行增加
和
4 行删除
+7
-4
MyConfigSession.scala
src/main/scala/com/config/MyConfigSession.scala
+1
-1
SessionProcessPath.scala
src/main/scala/com/session/SessionProcessPath.scala
+6
-3
未找到文件。
src/main/scala/com/config/MyConfigSession.scala
浏览文件 @
7dec4501
...
@@ -71,7 +71,7 @@ object MyConfigSession {
...
@@ -71,7 +71,7 @@ object MyConfigSession {
//从dw_fact_log_session表中筛选数据
//从dw_fact_log_session表中筛选数据
final
val
SOURCE_SQL_PATH
:
String
=
final
val
SOURCE_SQL_PATH
:
String
=
s
"""
s
"""
|select id log_session_id, session_id,user_id_int user_id,action_type,user_token,menu_code,action_code,position,label_value,label_class,
|select id log_session_id, session_id,user_id_int user_id,
device_token,
action_type,user_token,menu_code,action_code,position,label_value,label_class,
|app_version,device_type,created_time,date_time,module_class1,module_class2 from ${MyConfigSession.HIVE_TABLE1}
|app_version,device_type,created_time,date_time,module_class1,module_class2 from ${MyConfigSession.HIVE_TABLE1}
| where app_version >= '3.1.7'
| where app_version >= '3.1.7'
| AND ((action_type ='ACTION_CLICK' and action_code != 'null' ) OR action_type ='ACTION_VIEW' )
| AND ((action_type ='ACTION_CLICK' and action_code != 'null' ) OR action_type ='ACTION_VIEW' )
...
...
src/main/scala/com/session/SessionProcessPath.scala
浏览文件 @
7dec4501
...
@@ -104,7 +104,9 @@ object SessionProcessPath {
...
@@ -104,7 +104,9 @@ object SessionProcessPath {
rowList
.
append
(
Row
(
rowList
.
append
(
Row
(
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"log_session_id"
)),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"log_session_id"
)),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"session_id"
)),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"session_id"
)),
row
.
getAs
[
Integer
](
"user_id"
),
action_type
,
row
.
getAs
[
Integer
](
"user_id"
),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"device_token"
)),
action_type
,
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"user_token"
)),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"user_token"
)),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"menu_code"
)),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"menu_code"
)),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"action_code"
)),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"action_code"
)),
...
@@ -189,7 +191,7 @@ object SessionProcessPath {
...
@@ -189,7 +191,7 @@ object SessionProcessPath {
//去掉refer字段中的NULL值
//去掉refer字段中的NULL值
val
coaleseDF
:
DataFrame
=
rowNumberDF
.
selectExpr
(
val
coaleseDF
:
DataFrame
=
rowNumberDF
.
selectExpr
(
"log_session_id"
,
"session_id"
,
"user_id"
,
"action_type"
,
"user_token"
,
"menu_code"
,
"action_code"
,
"position"
,
"label_value"
,
"label_class"
,
"log_session_id"
,
"session_id"
,
"user_id"
,
"device_token"
,
"action_type"
,
"user_token"
,
"menu_code"
,
"action_code"
,
"position"
,
"label_value"
,
"label_class"
,
"COALESCE(refer_menu_code,'') as refer_menu_code"
,
"COALESCE(refer_menu_code,'') as refer_menu_code"
,
"COALESCE(refer_action_code,'') as refer_action_code"
,
"COALESCE(refer_action_code,'') as refer_action_code"
,
"COALESCE(refer_position,'') as refer_position"
,
"COALESCE(refer_position,'') as refer_position"
,
...
@@ -220,7 +222,8 @@ object SessionProcessPath {
...
@@ -220,7 +222,8 @@ object SessionProcessPath {
| select log_session_id, session_id,user_id,action_type,user_token,menu_code,action_code,position,label_value,label_class,
| select log_session_id, session_id,user_id,action_type,user_token,menu_code,action_code,position,label_value,label_class,
| refer_menu_code,refer_action_code,refer_position,refer_action_type,
| refer_menu_code,refer_action_code,refer_position,refer_action_type,
| cast(refer_time_diff as int) as refer_time_diff,
| cast(refer_time_diff as int) as refer_time_diff,
| step_id,app_version,device_type,created_time,date_time, module_class1, module_class2
| step_id,app_version,device_type,created_time,date_time, module_class1, module_class2,
| case when user_id=0 then device_token else user_id end user_identity_id
| from result_view distribute by rand()
| from result_view distribute by rand()
"""
.
stripMargin
"""
.
stripMargin
sparkSession
.
sql
(
loadDataSql
)
sparkSession
.
sql
(
loadDataSql
)
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录