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

修改test file

parent e32b29f2
...@@ -20,9 +20,9 @@ def test(): ...@@ -20,9 +20,9 @@ def test():
spark = SparkSession.builder.config(conf= sparkConf).enableHiveSupport().getOrCreate() spark = SparkSession.builder.config(conf= sparkConf).enableHiveSupport().getOrCreate()
# ti = pti.TiContext(spark) # ti = pti.TiContext(spark)
# ti.tidbMapDatabase("jerry_test") # ti.tidbMapDatabase("jerry_test")
spark.sql("use jerry_test")
spark.sparkContext.setLogLevel("WARN") spark.sparkContext.setLogLevel("WARN")
df = spark.sql("select max(stat_date) from jerry_test.esmm_train_data") df = spark.sql("select max(stat_date) from esmm_train_data")
df.show() df.show()
t = df.rdd.map(lambda x: str(x[0])).collect() t = df.rdd.map(lambda x: str(x[0])).collect()
print(t.count()) print(t.count())
......
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