Commit f74cd085 authored by 郭羽's avatar 郭羽

service model 优化

parent 2d97dda5
...@@ -335,7 +335,7 @@ def itemFeaturesToRedis(samples,itemDF,columns,redisKey): ...@@ -335,7 +335,7 @@ def itemFeaturesToRedis(samples,itemDF,columns,redisKey):
conn.set(newKey, v) conn.set(newKey, v)
conn.expire(newKey, 60 * 60 * 24 * 7) conn.expire(newKey, 60 * 60 * 24 * 7)
item_static_columns = [col for col in samples.columns if col.endswith("Bucket") or col.endswith("_number")] item_static_columns = [idCol] + [col for col in columns if col.endswith("Bucket") or col.endswith("_number")]
#根据timestamp获取每个user最新的记录 #根据timestamp获取每个user最新的记录
prefixSamples = samples.groupBy(idCol).agg(F.max("timestamp").alias(timestampCol)) prefixSamples = samples.groupBy(idCol).agg(F.max("timestamp").alias(timestampCol))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment