Commit 330993c8 authored by 张彦钊's avatar 张彦钊

change test file

parent eab72ec5
......@@ -23,19 +23,20 @@ def esmm_pre():
print(yesterday)
spark = SparkSession.builder.enableHiveSupport().getOrCreate()
gw = SparkContext._gateway
java_import(gw.jvm, "org.apache.spark.sql.TiContext")
# java_import(gw.jvm, "org.apache.spark.sql.TiExtensions")
# conf = SparkConf().setAppName("esmm_pre").set("spark.io.compression.codec", "lzf")
# Import TiExtensions
java_import(gw.jvm, "org.apache.spark.sql.TiExtensions")
# Inject TiExtensions, and get a TiContext
ti = gw.jvm.TiExtensions.getInstance(spark._jsparkSession).getOrCreateTiContext(spark._jsparkSession)
# Map database as old api does
ti.tidbMapDatabase("jerry_test")
# sql("use tpch_test")
spark.sql("select count(*) from esmm_pre_data").show(6)
# conf = SparkConf().setAppName("esmm_pre").set("spark.io.compression.codec", "lzf")
#
# spark.sql("""
# select concat(tmp1.device_id,",",tmp1.city_id) as device_city, tmp1.merge_queue from (select device_id,if(city_id='world','worldwide',city_id) city_id,similarity_cid as merge_queue from nd_device_cid_similarity_matrix
......
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