Quellcode durchsuchen

fix: 企业动态过滤大于当前时间的动态

许家凯 vor 4 Jahren
Ursprung
Commit
45a1afe5d7

+ 1 - 0
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/CompanyDynamic.scala

@@ -175,6 +175,7 @@ object CompanyDynamic {
            |FROM
            |    company_dynamic_tmp$tableName
            |WHERE id IS NOT NULL
+           |AND   to_timestamp(change_time) <= now()
            |""".stripMargin)
     }
   }

+ 2 - 0
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/CompanyDynamicForDayCount.scala

@@ -128,6 +128,8 @@ case class CompanyDynamicForDayCount(s: SparkSession,
          |SELECT ${cols.mkString(",")}
          |FROM
          |    company_dynamic_tmp$tableName
+         |where id is not null
+         |and to_timestamp(change_time) <= now()
          |""".stripMargin)
   }
 }

+ 2 - 0
src/main/scala/com/winhc/bigdata/spark/jobs/message/IntellectualMessage.scala

@@ -185,6 +185,8 @@ case class IntellectualMessage(s: SparkSession, project: String,
          |INSERT ${if (isWindows) "INTO" else "OVERWRITE"} TABLE ${res_tb_res} PARTITION (ds='$ds',tn='$tn')
          |select * from res
          |where id <> '-1'
+         |and id is not null
+         |and to_timestamp(change_time) <= now()
          |""".stripMargin)
 
     println("end transForm" + new Date())