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
21aaf34f
Commit
21aaf34f
authored
Oct 29, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite session data
parent
4e02c168
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
tractate.py
word_vector/tractate.py
+6
-3
No files found.
word_vector/tractate.py
View file @
21aaf34f
...
...
@@ -45,9 +45,9 @@ def get_spark(app_name=""):
def
get_tracate_click_data
(
spark
,
start
,
end
):
reg
=
r"""^\\d+$"""
sql
=
"""
SELECT DISTINCT t1.partition_date, t1.cl_id, cast(t1.business_id as int) card_id
SELECT DISTINCT t1.partition_date, t1.cl_id, cast(t1.business_id as int) card_id
, t1.app_session_id
FROM
(select partition_date,cl_id,business_id,action,page_name,page_stay
(select partition_date,cl_id,business_id,action,page_name,page_stay
, app_session_id
from online.bl_hdfs_maidian_updates
where action = 'page_view'
AND partition_date BETWEEN '{}' AND '{}'
...
...
@@ -149,7 +149,10 @@ def get_device_click_tractate_ids_dict(click_df):
res
=
defaultdict
(
list
)
cols
=
click_df
.
orderBy
(
"partition_date"
,
ascending
=
False
)
.
collect
()
for
i
in
cols
:
res
[
i
[
"cl_id"
]]
.
append
(
i
[
"card_id"
])
card_id
=
i
[
"card_id"
]
session_id
=
i
[
"app_session_id"
]
if
card_id
not
in
res
[
session_id
]:
res
[
session_id
]
.
append
(
card_id
)
return
res
...
...
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