Commit 58bf3413 authored by 宋柯's avatar 宋柯

模型bug修复

parent 794211e6
...@@ -1001,12 +1001,13 @@ if __name__ == '__main__': ...@@ -1001,12 +1001,13 @@ if __name__ == '__main__':
card_id, card_id,
label, label,
partition_date, partition_date,
COALESCE(SUM(label_count) OVER(PARTITION BY card_id, label ORDER BY partition_date ROWS BETWEEN ${itemStatisticStartDays} PRECEDING AND 1 PRECEDING), 0) label_count_sum, COALESCE(SUM(label_count) OVER(PARTITION BY card_id, label ORDER BY partition_date ROWS BETWEEN {itemStatisticStartDays} PRECEDING AND 1 PRECEDING), 0) label_count_sum,
COALESCE(AVG(label_count) OVER(PARTITION BY card_id, label ORDER BY partition_date ROWS BETWEEN ${itemStatisticStartDays} PRECEDING AND 1 PRECEDING), 0) label_count_avg, COALESCE(AVG(label_count) OVER(PARTITION BY card_id, label ORDER BY partition_date ROWS BETWEEN {itemStatisticStartDays} PRECEDING AND 1 PRECEDING), 0) label_count_avg,
COALESCE(STDDEV(label_count) OVER(PARTITION BY card_id, label ORDER BY partition_date ROWS BETWEEN ${itemStatisticStartDays} PRECEDING AND 1 PRECEDING), 0) label_count_stddev COALESCE(STDDEV(label_count) OVER(PARTITION BY card_id, label ORDER BY partition_date ROWS BETWEEN {itemStatisticStartDays} PRECEDING AND 1 PRECEDING), 0) label_count_stddev
FROM FROM
itemStatisticDF itemStatisticDF
""".format(itemStatisticStartDays = itemStatisticStartDays) """.format(itemStatisticStartDays = itemStatisticStartDays)
print(itemStatisticSql)
spark.sql(itemStatisticSql).show(100, False) spark.sql(itemStatisticSql).show(100, False)
sys.exit(1) sys.exit(1)
clickDF = spark.sql(clickSql) clickDF = spark.sql(clickSql)
......
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