Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
L
label
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
zhenxin.ma
label
提交
64f9fd42
提交
64f9fd42
编写于
7月 14, 2021
作者:
weicheng.mao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新路径漏斗分析底表
上级
25f7602b
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
7 行增加
和
5 行删除
+7
-5
SessionPathConvert.scala
src/main/scala/com/session/SessionPathConvert.scala
+5
-4
Driver.scala
src/main/scala/com/utils/Driver.scala
+2
-1
未找到文件。
src/main/scala/com/session/SessionPathConvert.scala
浏览文件 @
64f9fd42
...
@@ -54,7 +54,7 @@ object SessionPathConvert {
...
@@ -54,7 +54,7 @@ object SessionPathConvert {
//获取MYSQL连接
//获取MYSQL连接
val
connSql
:
sql.Connection
=
JDBCUtil
.
getConnection
()
val
connSql
:
sql.Connection
=
JDBCUtil
.
getConnection
()
//向 record 表插入数据
//向 record 表插入数据
//
val flag: Int = JDBCUtil.insertRecord(connSql, insertSQL, insertArr)
val
flag
:
Int
=
JDBCUtil
.
insertRecord
(
connSql
,
insertSQL
,
insertArr
)
val
session_path_convert
=
SessionPathConvert
()
val
session_path_convert
=
SessionPathConvert
()
try
{
try
{
val
sparkSession
:
SparkSession
=
session_path_convert
.
getSparkSession
(
"Session_path_convert"
)
val
sparkSession
:
SparkSession
=
session_path_convert
.
getSparkSession
(
"Session_path_convert"
)
...
@@ -110,7 +110,7 @@ object SessionPathConvert {
...
@@ -110,7 +110,7 @@ object SessionPathConvert {
|update ${MyConfigSession.JDBC_TABLE} set status=?,exception=?,end_time=? where job_id=0 and start_time='${startTime}'
|update ${MyConfigSession.JDBC_TABLE} set status=?,exception=?,end_time=? where job_id=0 and start_time='${startTime}'
"""
.
stripMargin
"""
.
stripMargin
val
errorArr
=
Array
[
String
](
"2"
,
e
.
getMessage
,
DateUtils
.
getTodayTime
)
val
errorArr
=
Array
[
String
](
"2"
,
e
.
getMessage
,
DateUtils
.
getTodayTime
)
//
JDBCUtil.insertRecord(connSql, exceptionSQL, errorArr)
JDBCUtil
.
insertRecord
(
connSql
,
exceptionSQL
,
errorArr
)
connSql
.
close
()
connSql
.
close
()
}
}
...
@@ -123,8 +123,9 @@ object SessionPathConvert {
...
@@ -123,8 +123,9 @@ object SessionPathConvert {
class
SessionPathConvert
{
class
SessionPathConvert
{
def
getSparkSession
(
appName
:
String
)
:
SparkSession
=
{
def
getSparkSession
(
appName
:
String
)
:
SparkSession
=
{
val
conf
:
SparkConf
=
new
SparkConf
().
setAppName
(
appName
).
setMaster
(
"local[*]"
)
val
conf
:
SparkConf
=
new
SparkConf
().
setAppName
(
appName
)
.
set
(
"dfs.client.use.datanode.hostname"
,
"true"
)
// .setMaster("local[*]")
// .set("dfs.client.use.datanode.hostname","true")
UseUtil
.
setConfigure
(
conf
)
UseUtil
.
setConfigure
(
conf
)
val
sparkSession
:
SparkSession
=
SparkSession
.
builder
().
config
(
conf
).
enableHiveSupport
().
getOrCreate
()
val
sparkSession
:
SparkSession
=
SparkSession
.
builder
().
config
(
conf
).
enableHiveSupport
().
getOrCreate
()
sparkSession
sparkSession
...
...
src/main/scala/com/utils/Driver.scala
浏览文件 @
64f9fd42
package
com.utils
package
com.utils
import
com.session.
{
SessionMenuCalc
,
SessionP
rocess
,
SessionProcessPath
,
SessionProcessPathNew
,
SessionProcessTerm
}
import
com.session.
{
SessionMenuCalc
,
SessionP
athConvert
,
SessionProcess
,
SessionProcessPath
,
SessionProcessPathNew
,
SessionProcessTerm
}
import
org.apache.hadoop.util.ProgramDriver
import
org.apache.hadoop.util.ProgramDriver
/**
/**
...
@@ -16,6 +16,7 @@ object Driver {
...
@@ -16,6 +16,7 @@ object Driver {
driver
.
addClass
(
"SessionMenuCalc"
,
classOf
[
SessionMenuCalc
],
"传递日期参数--用户Session数据分析导入到dw_fact_log_session_menu_calc表"
)
driver
.
addClass
(
"SessionMenuCalc"
,
classOf
[
SessionMenuCalc
],
"传递日期参数--用户Session数据分析导入到dw_fact_log_session_menu_calc表"
)
driver
.
addClass
(
"SessionProcessTerm"
,
classOf
[
SessionProcessTerm
],
"传递日期参数--用户Session数据etl导入到dw_fact_log_sesson_term表"
)
driver
.
addClass
(
"SessionProcessTerm"
,
classOf
[
SessionProcessTerm
],
"传递日期参数--用户Session数据etl导入到dw_fact_log_sesson_term表"
)
driver
.
addClass
(
"SessionProcessPathNew"
,
classOf
[
SessionProcessPathNew
],
"用户Session数据分析导入到dw_fact_log_session_path_new表"
)
driver
.
addClass
(
"SessionProcessPathNew"
,
classOf
[
SessionProcessPathNew
],
"用户Session数据分析导入到dw_fact_log_session_path_new表"
)
driver
.
addClass
(
"SessionPathConvert"
,
classOf
[
SessionPathConvert
],
"用户Session数据分析导入到dw_fact_log_session_path_convert表"
)
driver
.
run
(
args
)
driver
.
run
(
args
)
}
}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录