This commit is contained in:
parent
4a8a5288f4
commit
d6afa62c5f
|
@ -41,16 +41,16 @@ if __name__ == "__main__":
|
||||||
.enableHiveSupport() \
|
.enableHiveSupport() \
|
||||||
.getOrCreate()
|
.getOrCreate()
|
||||||
|
|
||||||
df = sqlContext.sql("select count(*) as N from jd_comment")
|
df = spark.sql("select count(*) as N from jd_comment")
|
||||||
jd_comment_count = df.rdd.collect()[0]["N"]
|
jd_comment_count = df.rdd.collect()[0]["N"]
|
||||||
|
|
||||||
df = sqlContext.sql("select count(*) as N from jd_comment where created_at like '"+today()+"%'")
|
df = spark.sql("select count(*) as N from jd_comment where created_at like '"+today()+"%'")
|
||||||
jd_comment_today_count = df.rdd.collect()[0]["N"]
|
jd_comment_today_count = df.rdd.collect()[0]["N"]
|
||||||
|
|
||||||
df = sqlContext.sql("select count(*) as N from jd")
|
df = spark.sql("select count(*) as N from jd")
|
||||||
jd_count = df.rdd.collect()[0]["N"]
|
jd_count = df.rdd.collect()[0]["N"]
|
||||||
|
|
||||||
df = sqlContext.sql("select count(*) as N from jd where created_at like '"+today()+"%'")
|
df = spark.sql("select count(*) as N from jd where created_at like '"+today()+"%'")
|
||||||
jd_today_count = df.rdd.collect()[0]["N"]
|
jd_today_count = df.rdd.collect()[0]["N"]
|
||||||
|
|
||||||
total_count = jd_comment_count + jd_count
|
total_count = jd_comment_count + jd_count
|
||||||
|
|
Loading…
Reference in New Issue