Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
71558f3b
Commit
71558f3b
authored
May 21, 2020
by
任婷婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
765c1770
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
tag3_update_user_portrait_offline.py
eda/smart_rank/tag3_update_user_portrait_offline.py
+7
-7
No files found.
eda/smart_rank/tag3_update_user_portrait_offline.py
View file @
71558f3b
...
...
@@ -96,10 +96,10 @@ def update_tag3_user_portrait(cl_id):
# redis_client.set(key2, json.dumps(res2))
# redis_client.expire(key2, 60 * 60 * 24 * 30)
# print('*'*10)
#
write_user_portrait(cl_id, ",".join(first_solutions_score.keys()), ",".join(second_solutions_score.keys()),
#
",".join(first_demands_score.keys()), ",".join(second_demands_score.keys()),
#
",".join(first_positions_score.keys()), ",".join(second_positions_score.keys()),
#
",".join(projects_score.keys()))
write_user_portrait
(
cl_id
,
","
.
join
(
first_solutions_score
.
keys
()),
","
.
join
(
second_solutions_score
.
keys
()),
","
.
join
(
first_demands_score
.
keys
()),
","
.
join
(
second_demands_score
.
keys
()),
","
.
join
(
first_positions_score
.
keys
()),
","
.
join
(
second_positions_score
.
keys
()),
","
.
join
(
projects_score
.
keys
()))
first_solutions
=
[]
first_positions
=
[]
...
...
@@ -166,7 +166,7 @@ def consume_kafka():
.
set
(
"spark.driver.maxResultSize"
,
"8g"
)
\
.
set
(
"spark.sql.avro.compression.codec"
,
"snappy"
)
try
:
#
try:
spark
=
SparkSession
.
builder
.
config
(
conf
=
sparkConf
)
.
enableHiveSupport
()
.
getOrCreate
()
spark
.
sparkContext
.
setLogLevel
(
"WARN"
)
spark
.
sparkContext
.
addPyFile
(
"/srv/apps/ffm-baseline_git/eda/smart_rank/tool.py"
)
...
...
@@ -176,8 +176,8 @@ def consume_kafka():
# result.foreach(print)
result
.
collect
()
spark
.
stop
()
except
Exception
as
e
:
send_email
(
"tag3_update_user_portrait_offline"
,
"tag3_update_user_portrait_offline"
,
e
)
#
except Exception as e:
#
send_email("tag3_update_user_portrait_offline", "tag3_update_user_portrait_offline", e)
if
__name__
==
"__main__"
:
...
...
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