Commit 4e3d8588 authored by 张彦钊's avatar 张彦钊

修改测试文件

parent ab276ff1
...@@ -20,10 +20,11 @@ def test(): ...@@ -20,10 +20,11 @@ def test():
def esmm_pre(): def esmm_pre():
yesterday = (datetime.date.today() - datetime.timedelta(days=1)).strftime("%Y-%m-%d") yesterday = (datetime.date.today() - datetime.timedelta(days=1)).strftime("%Y-%m-%d")
print(yesterday) print(yesterday)
gw = SparkContext._gateway gw = SparkContext._gateway
# java_import(gw.jvm, "org.apache.spark.sql.TiExtensions") # java_import(gw.jvm, "org.apache.spark.sql.TiExtensions")
conf = SparkConf().setAppName("esmm_pre").set("spark.io.compression.codec", "lzf") # conf = SparkConf().setAppName("esmm_pre").set("spark.io.compression.codec", "lzf")
spark = SparkSession.builder.enableHiveSupport().config(conf=conf).getOrCreate() spark = SparkSession.builder.enableHiveSupport().getOrCreate()
ti = gw.jvm.TiExtensions.getInstance(spark._jsparkSession).getOrCreateTiContext(spark._jsparkSession) ti = gw.jvm.TiExtensions.getInstance(spark._jsparkSession).getOrCreateTiContext(spark._jsparkSession)
# Map database as old api does # Map database as old api does
......
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