Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
strategy_embedding
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
strategy_embedding
Commits
568715d5
Commit
568715d5
authored
Nov 05, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get tags
parent
a5881d91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
get_tractate_data.py
dssm/get_tractate_data.py
+23
-0
No files found.
dssm/get_tractate_data.py
View file @
568715d5
...
@@ -19,6 +19,26 @@ def get_ndays_before_no_minus(n):
...
@@ -19,6 +19,26 @@ def get_ndays_before_no_minus(n):
return
get_ndays_before_with_format
(
n
,
"
%
Y
%
m
%
d"
)
return
get_ndays_before_with_format
(
n
,
"
%
Y
%
m
%
d"
)
def
connect_doris
(
spark
,
table
):
return
spark
.
read
.
format
(
"jdbc"
)
\
.
option
(
"driver"
,
"com.mysql.jdbc.Driver"
)
\
.
option
(
"url"
,
"jdbc:mysql://172.16.30.136:3306/doris_prod"
)
\
.
option
(
"dbtable"
,
table
)
\
.
option
(
"user"
,
"doris"
)
\
.
option
(
"password"
,
"o5gbA27hXHHm"
)
\
.
load
()
def
get_content_tag3
(
spark
,
card_type
):
if
card_type
==
"diary"
:
content_tag3
=
connect_doris
(
spark
,
"strategy_content_tagv3_info"
)
elif
card_type
==
"user_post"
:
content_tag3
=
connect_doris
(
spark
,
"strategy_tractate_tagv3_info"
)
else
:
content_tag3
=
connect_doris
(
spark
,
"strategy_answer_tagv3_info"
)
return
content_tag3
def
get_spark
(
app_name
=
""
):
def
get_spark
(
app_name
=
""
):
sparkConf
=
SparkConf
()
sparkConf
=
SparkConf
()
sparkConf
.
set
(
"spark.sql.crossJoin.enabled"
,
True
)
sparkConf
.
set
(
"spark.sql.crossJoin.enabled"
,
True
)
...
@@ -237,6 +257,9 @@ def get_exposure_data(spark, card_type, start, end):
...
@@ -237,6 +257,9 @@ def get_exposure_data(spark, card_type, start, end):
def
get_card_feature_df
(
spark
,
card_type
,
yesterday
):
def
get_card_feature_df
(
spark
,
card_type
,
yesterday
):
content_tag3
=
get_content_tag3
(
spark
,
card_type
)
content_tag3
.
createOrReplaceTempView
(
"content_tag3"
)
reg
=
r"""^\\d+$"""
reg
=
r"""^\\d+$"""
sql
=
"""
sql
=
"""
SELECT CAST(card_id as INT) as card_id,
SELECT CAST(card_id as INT) as card_id,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment