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

add multi file

parent 2303fc90
...@@ -12,7 +12,7 @@ def test(): ...@@ -12,7 +12,7 @@ def test():
spark = SparkSession.builder.enableHiveSupport().getOrCreate() spark = SparkSession.builder.enableHiveSupport().getOrCreate()
ti = pti.TiContext(spark) ti = pti.TiContext(spark)
ti.tidbMapDatabase("jerry_test") ti.tidbMapDatabase("jerry_test")
validate_date = spark.sql("select max(stat_date) from esmm_train_data").rdd.map(lambda x:x[0]) validate_date = spark.sql("select max(stat_date) from esmm_train_data").rdd.map(lambda x:str(x[0]))
print("validate_date:" + validate_date) print("validate_date:" + validate_date)
temp = datetime.datetime.strptime(validate_date, "%Y-%m-%d") temp = datetime.datetime.strptime(validate_date, "%Y-%m-%d")
start = (temp - datetime.timedelta(days=10)).strftime("%Y-%m-%d") start = (temp - datetime.timedelta(days=10)).strftime("%Y-%m-%d")
......
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