Commit 00416bf9 authored by 郭羽's avatar 郭羽

update olap conn

parent 1552b35d
...@@ -29,7 +29,7 @@ from meta_base_code.utils.func_from_redis_get_portrait import * ...@@ -29,7 +29,7 @@ from meta_base_code.utils.func_from_redis_get_portrait import *
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
...@@ -214,7 +214,7 @@ WHERE spam_pv.device_id IS NULL ...@@ -214,7 +214,7 @@ WHERE spam_pv.device_id IS NULL
) )
print(instert_sql) print(instert_sql)
# cursor.execute("set names 'UTF8'") # cursor.execute("set names 'UTF8'")
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
res = cursor.execute(instert_sql) res = cursor.execute(instert_sql)
...@@ -268,7 +268,7 @@ WHERE spam_pv.device_id IS NULL ...@@ -268,7 +268,7 @@ WHERE spam_pv.device_id IS NULL
) )
print(instert_sql) print(instert_sql)
# cursor.execute("set names 'UTF8'") # cursor.execute("set names 'UTF8'")
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
res = cursor.execute(instert_sql) res = cursor.execute(instert_sql)
......
...@@ -326,7 +326,7 @@ WHERE spam_pv.device_id IS NULL ...@@ -326,7 +326,7 @@ WHERE spam_pv.device_id IS NULL
) )
print(instert_sql) print(instert_sql)
# cursor.execute("set names 'UTF8'") # cursor.execute("set names 'UTF8'")
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
res = cursor.execute(instert_sql) res = cursor.execute(instert_sql)
......
...@@ -29,7 +29,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -29,7 +29,7 @@ from pyspark.sql import SparkSession, DataFrame
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
...@@ -980,7 +980,7 @@ on t1.device_id = t2.cl_id""".format(partition_date=today_str) ...@@ -980,7 +980,7 @@ on t1.device_id = t2.cl_id""".format(partition_date=today_str)
) )
print(instert_sql) print(instert_sql)
# cursor.execute("set names 'UTF8'") # cursor.execute("set names 'UTF8'")
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
res = cursor.execute(instert_sql) res = cursor.execute(instert_sql)
......
...@@ -28,7 +28,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -28,7 +28,7 @@ from pyspark.sql import SparkSession, DataFrame
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
......
...@@ -70,7 +70,7 @@ task_days = 2 ...@@ -70,7 +70,7 @@ task_days = 2
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
......
...@@ -64,7 +64,7 @@ from meta_base_code.utils.func_from_es_get_article import get_es_article_num, ge ...@@ -64,7 +64,7 @@ from meta_base_code.utils.func_from_es_get_article import get_es_article_num, ge
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
......
...@@ -67,7 +67,7 @@ task_days = 2 ...@@ -67,7 +67,7 @@ task_days = 2
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
......
...@@ -23,7 +23,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -23,7 +23,7 @@ from pyspark.sql import SparkSession, DataFrame
from pyspark.sql.functions import lit from pyspark.sql.functions import lit
import pytispark.pytispark as pti import pytispark.pytispark as pti
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
...@@ -31,7 +31,7 @@ cursor = db.cursor() ...@@ -31,7 +31,7 @@ cursor = db.cursor()
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
......
...@@ -26,7 +26,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -26,7 +26,7 @@ from pyspark.sql import SparkSession, DataFrame
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
...@@ -87,7 +87,7 @@ device_df = spark.sql(sql) ...@@ -87,7 +87,7 @@ device_df = spark.sql(sql)
device_df.show(1, False) device_df.show(1, False)
sql_res = device_df.collect() sql_res = device_df.collect()
print("-----------------------------------------------------------------------------") print("-----------------------------------------------------------------------------")
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
for res in sql_res: for res in sql_res:
......
...@@ -541,7 +541,7 @@ FROM ...@@ -541,7 +541,7 @@ FROM
sql_res = device_df.collect() sql_res = device_df.collect()
for res in sql_res: for res in sql_res:
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
print(res) print(res)
......
...@@ -197,7 +197,7 @@ for t in range(0, task_days): ...@@ -197,7 +197,7 @@ for t in range(0, task_days):
partition_date = str(now + datetime.timedelta(days=-1)) partition_date = str(now + datetime.timedelta(days=-1))
tag_names_list_week.append((word, nums, uv,partition_date)) tag_names_list_week.append((word, nums, uv,partition_date))
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
insert_sql = "replace into daily_search_word_count(word, nums, uv,pid,partition_day) VALUES(%s,%s,%s,%s,%s)" insert_sql = "replace into daily_search_word_count(word, nums, uv,pid,partition_day) VALUES(%s,%s,%s,%s,%s)"
......
...@@ -213,7 +213,7 @@ for t in range(0, task_days): ...@@ -213,7 +213,7 @@ for t in range(0, task_days):
partition_date = str(now + datetime.timedelta(days=-1)) partition_date = str(now + datetime.timedelta(days=-1))
tag_names_list_week.append((word, nums, uv, partition_date)) tag_names_list_week.append((word, nums, uv, partition_date))
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
insert_sql = "replace into daily_search_word_count_fix(word, nums, uv,pid,partition_day) VALUES(%s,%s,%s,%s,%s)" insert_sql = "replace into daily_search_word_count_fix(word, nums, uv,pid,partition_day) VALUES(%s,%s,%s,%s,%s)"
......
...@@ -304,7 +304,7 @@ for t in range(1, task_days): ...@@ -304,7 +304,7 @@ for t in range(1, task_days):
# pid = hashlib.md5((today_str + keywords).encode("utf8")).hexdigest() # pid = hashlib.md5((today_str + keywords).encode("utf8")).hexdigest()
tag_names_list_week.append((key_count, keywords, today_str, is_delete, servise_num, pv, is_tag)) tag_names_list_week.append((key_count, keywords, today_str, is_delete, servise_num, pv, is_tag))
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
# db = pymysql.connect(host='bj-cdb-6slgqwlc.sql.tencentcdb.com', port=62120, user='work', passwd='Gengmei1', # db = pymysql.connect(host='bj-cdb-6slgqwlc.sql.tencentcdb.com', port=62120, user='work', passwd='Gengmei1',
# db='doris_prod') # db='doris_prod')
......
...@@ -35,7 +35,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -35,7 +35,7 @@ from pyspark.sql import SparkSession, DataFrame
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
...@@ -422,7 +422,7 @@ group by partition_day ...@@ -422,7 +422,7 @@ group by partition_day
cpc_item_pricing = cpc_proportion_expend_recharge_amount/cpc_click_num cpc_item_pricing = cpc_proportion_expend_recharge_amount/cpc_click_num
cpc_flow_rat = cpc_click_num / welfare_pv cpc_flow_rat = cpc_click_num / welfare_pv
# tol_proportion_expend_amount # tol_proportion_expend_amount
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
partition_date = yesterday_str partition_date = yesterday_str
......
...@@ -46,7 +46,7 @@ from meta_base_code.utils.func_from_es_get_article import get_es_article_num, ge ...@@ -46,7 +46,7 @@ from meta_base_code.utils.func_from_es_get_article import get_es_article_num, ge
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
......
...@@ -20,7 +20,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -20,7 +20,7 @@ from pyspark.sql import SparkSession, DataFrame
# from pyspark.sql.functions import lit # from pyspark.sql.functions import lit
# import pytispark.pytispark as pti # import pytispark.pytispark as pti
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
...@@ -28,7 +28,7 @@ cursor = db.cursor() ...@@ -28,7 +28,7 @@ cursor = db.cursor()
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
......
...@@ -28,7 +28,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -28,7 +28,7 @@ from pyspark.sql import SparkSession, DataFrame
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
...@@ -195,7 +195,7 @@ order by 1 ...@@ -195,7 +195,7 @@ order by 1
pid = hashlib.md5( pid = hashlib.md5(
(partition_date + device_os_type + active_type + grey_type).encode("utf8")).hexdigest() (partition_date + device_os_type + active_type + grey_type).encode("utf8")).hexdigest()
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
commit_sql = """replace into meigou_data(partition_date,device_os_type,active_type,grey_type,clickpv_div_exposurepv, commit_sql = """replace into meigou_data(partition_date,device_os_type,active_type,grey_type,clickpv_div_exposurepv,
......
...@@ -31,7 +31,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -31,7 +31,7 @@ from pyspark.sql import SparkSession, DataFrame
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
...@@ -190,7 +190,7 @@ for redis_count,res in enumerate(user_portrait_scan): ...@@ -190,7 +190,7 @@ for redis_count,res in enumerate(user_portrait_scan):
) )
# print(instert_sql) # print(instert_sql)
# cursor.execute("set names 'UTF8'") # cursor.execute("set names 'UTF8'")
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
res = cursor.execute(instert_sql) res = cursor.execute(instert_sql)
...@@ -215,7 +215,7 @@ for page_type in range(3): ...@@ -215,7 +215,7 @@ for page_type in range(3):
) )
# print(instert_sql) # print(instert_sql)
# cursor.execute("set names 'UTF8'") # cursor.execute("set names 'UTF8'")
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
res = cursor.execute(instert_sql) res = cursor.execute(instert_sql)
......
...@@ -22,7 +22,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -22,7 +22,7 @@ from pyspark.sql import SparkSession, DataFrame
# from pyspark.sql.functions import lit # from pyspark.sql.functions import lit
# import pytispark.pytispark as pti # import pytispark.pytispark as pti
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
...@@ -30,7 +30,7 @@ cursor = db.cursor() ...@@ -30,7 +30,7 @@ cursor = db.cursor()
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
......
...@@ -22,14 +22,14 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -22,14 +22,14 @@ from pyspark.sql import SparkSession, DataFrame
# from pyspark.sql.functions import lit # from pyspark.sql.functions import lit
# import pytispark.pytispark as pti # import pytispark.pytispark as pti
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
......
...@@ -28,7 +28,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -28,7 +28,7 @@ from pyspark.sql import SparkSession, DataFrame
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
...@@ -205,7 +205,7 @@ for t in range(0, task_days): ...@@ -205,7 +205,7 @@ for t in range(0, task_days):
) )
print(instert_sql) print(instert_sql)
# cursor.execute("set names 'UTF8'") # cursor.execute("set names 'UTF8'")
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
res = cursor.execute(instert_sql) res = cursor.execute(instert_sql)
......
...@@ -28,7 +28,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -28,7 +28,7 @@ from pyspark.sql import SparkSession, DataFrame
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
...@@ -198,7 +198,7 @@ group by t1.partition_date,device_os_type,active_type,channel ...@@ -198,7 +198,7 @@ group by t1.partition_date,device_os_type,active_type,channel
print(instert_sql_diary) print(instert_sql_diary)
print(instert_sql_qa) print(instert_sql_qa)
# cursor.execute("set names 'UTF8'") # cursor.execute("set names 'UTF8'")
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
res = cursor.execute(instert_sql_diary) res = cursor.execute(instert_sql_diary)
......
...@@ -28,7 +28,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -28,7 +28,7 @@ from pyspark.sql import SparkSession, DataFrame
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
...@@ -207,7 +207,7 @@ for t in range(0, task_days): ...@@ -207,7 +207,7 @@ for t in range(0, task_days):
) )
print(instert_sql) print(instert_sql)
# cursor.execute("set names 'UTF8'") # cursor.execute("set names 'UTF8'")
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
res = cursor.execute(instert_sql) res = cursor.execute(instert_sql)
......
...@@ -24,7 +24,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -24,7 +24,7 @@ from pyspark.sql import SparkSession, DataFrame
# from pyspark.sql.functions import lit # from pyspark.sql.functions import lit
# import pytispark.pytispark as pti # import pytispark.pytispark as pti
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
......
...@@ -28,7 +28,7 @@ from pyspark.sql import SparkSession, DataFrame ...@@ -28,7 +28,7 @@ from pyspark.sql import SparkSession, DataFrame
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
...@@ -204,7 +204,7 @@ for t in range(0, task_days): ...@@ -204,7 +204,7 @@ for t in range(0, task_days):
) )
print(instert_sql) print(instert_sql)
# cursor.execute("set names 'UTF8'") # cursor.execute("set names 'UTF8'")
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
res = cursor.execute(instert_sql) res = cursor.execute(instert_sql)
......
...@@ -35,7 +35,7 @@ from meta_base_code.utils.func_from_redis_get_portrait import * ...@@ -35,7 +35,7 @@ from meta_base_code.utils.func_from_redis_get_portrait import *
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
......
...@@ -32,7 +32,7 @@ def con_sql(sql): ...@@ -32,7 +32,7 @@ def con_sql(sql):
# db = pymysql.connect(host='172.16.40.158', port=4000, user='st_user', passwd='aqpuBLYzEV7tML5RPsN1pntUzFy', # db = pymysql.connect(host='172.16.40.158', port=4000, user='st_user', passwd='aqpuBLYzEV7tML5RPsN1pntUzFy',
# db='jerry_prod') # db='jerry_prod')
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
...@@ -206,7 +206,7 @@ SELECT * FROM online.bl_hdfs_maidian_updates ...@@ -206,7 +206,7 @@ SELECT * FROM online.bl_hdfs_maidian_updates
# ) # )
# print(instert_sql) # print(instert_sql)
# # cursor.execute("set names 'UTF8'") # # cursor.execute("set names 'UTF8'")
# db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', # db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
# db='doris_olap') # db='doris_olap')
# cursor = db.cursor() # cursor = db.cursor()
# res = cursor.execute(instert_sql) # res = cursor.execute(instert_sql)
......
...@@ -44,7 +44,7 @@ from meta_base_code.utils.func_from_es_get_article import get_es_article_num, ge ...@@ -44,7 +44,7 @@ from meta_base_code.utils.func_from_es_get_article import get_es_article_num, ge
def con_sql(sql): def con_sql(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
......
...@@ -19,7 +19,7 @@ es = Elasticsearch([ ...@@ -19,7 +19,7 @@ es = Elasticsearch([
def con_sql_jerry_prod(sql): def con_sql_jerry_prod(sql):
# 从数据库的表里获取数据 # 从数据库的表里获取数据
db = pymysql.connect(host='172.16.50.175', port=3306, user='doris', passwd='o5gbA27hXHHm', db = pymysql.connect(host='172.16.30.136', port=3306, user='doris_olap', passwd='bA27hXasdfswuolap',
db='doris_olap') db='doris_olap')
cursor = db.cursor() cursor = db.cursor()
cursor.execute(sql) cursor.execute(sql)
......
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