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

修改test file

parent 2eb33716
......@@ -18,11 +18,11 @@ def test():
.set("spark.tispark.pd.addresses", "172.16.40.158:2379")
spark = SparkSession.builder.config(conf= sparkConf).enableHiveSupport().getOrCreate()
ti = pti.TiContext(spark)
ti.tidbMapDatabase("jerry_test")
# ti = pti.TiContext(spark)
# ti.tidbMapDatabase("jerry_test")
spark.sparkContext.setLogLevel("WARN")
df = spark.sql("select max(stat_date) from esmm_train_data")
df = spark.sql("select max(stat_date) from jerry_test.esmm_train_data")
df.show()
t = df.rdd.map(lambda x: str(x[0])).collect()
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