Commit ce1e7762 authored by 张彦钊's avatar 张彦钊

change test file

parent ba9ae360
......@@ -212,17 +212,12 @@ def test():
spark.sql("ADD JAR /srv/apps/hive-udf-1.0-SNAPSHOT.jar")
spark.sql("CREATE TEMPORARY FUNCTION json_map AS 'brickhouse.udf.json.JsonMapUDF'")
spark.sql("CREATE TEMPORARY FUNCTION is_json AS 'com.gmei.hive.common.udf.UDFJsonFormatCheck'")
sql = "select user_id from online.tl_hdfs_maidian_view where partition_date = '20190412' limit 10"
spark.sql(sql).show(6)
ti = pti.TiContext(spark)
ti.tidbMapDatabase("jerry_test")
spark.sparkContext.setLogLevel("WARN")
df = spark.sql("select max(stat_date) from esmm_train_data")
df.show()
t = df.rdd.map(lambda x: str(x[0])).collect()
print(t)
df = spark.sql("select device_id,stat_date from esmm_train_data limit 60")
df.show(6)
df.write.csv('/recommend/tr', mode='overwrite', header=True)
# data = [(0, 18.0), (1, 19.0), (2, 8.0), (3, 5.0), (4, 2.2), (5, 9.2), (6, 14.4)]
......@@ -252,4 +247,5 @@ if __name__ == '__main__':
ti = pti.TiContext(spark)
ti.tidbMapDatabase("jerry_test")
spark.sparkContext.setLogLevel("WARN")
feature_engineer()
\ No newline at end of file
# feature_engineer()
test()
\ No newline at end of file
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