Commit 95b97877 by fangxingjun

no message

parent 6dd7a66e
......@@ -7,6 +7,7 @@ from utils.templates import Templates
from utils.secure_db_client import get_remote_engine
from utils.db_util import DbTypes, DBUtil
from utils.DorisHelper import DorisHelper
from pyspark.sql import functions as F
class ImgIdIndexToDoris(Templates):
......@@ -61,9 +62,10 @@ class ImgIdIndexToDoris(Templates):
df = self.df_id_index
count = df.count()
print(f"读取完成,数据量:{count}")
df = df.withColumn("created_time", F.current_timestamp())
df.show(10, truncate=False)
TABLE_COLUMNS = "img_unique,site_name,index,id,img_type"
TABLE_COLUMNS = "img_unique,site_name,`index`,id,img_type,created_time"
# ===== Step 2:写入 Doris selection.sys_edit_log =====
print(f"[2/2] 写入 Doris {self.doris_db}.{self.doris_table}")
DorisHelper.spark_export_with_columns(
......
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