|
@@ -1,7 +1,7 @@
|
|
|
package com.winhc.bigdata.spark.udf
|
|
|
|
|
|
import com.winhc.bigdata.spark.implicits.CompanyIndexSave2EsHelper
|
|
|
-import com.winhc.bigdata.spark.utils.BaseUtil
|
|
|
+import com.winhc.bigdata.spark.utils.{BaseUtil, LoggingUtils}
|
|
|
import com.winhc.bigdata.spark.utils.BaseUtil._
|
|
|
import org.apache.commons.lang3.StringUtils
|
|
|
import org.apache.spark.broadcast.Broadcast
|
|
@@ -16,7 +16,7 @@ import scala.annotation.meta.getter
|
|
|
* @Date: 2020/7/10 13:49
|
|
|
* @Description:
|
|
|
*/
|
|
|
-trait BaseFunc {
|
|
|
+trait BaseFunc extends LoggingUtils{
|
|
|
@(transient@getter) protected val spark: SparkSession
|
|
|
private val pattern = "[^\\u4e00-\\u9fa5a-zA-Z \\(\\)().]+".r
|
|
|
|
|
@@ -28,7 +28,7 @@ trait BaseFunc {
|
|
|
}*/
|
|
|
|
|
|
def addEmptyPartitionOrSkip(tab:String,ds:String): Unit ={
|
|
|
- spark.sql(
|
|
|
+ sql(
|
|
|
s"""
|
|
|
|ALTER TABLE $tab ADD IF NOT EXISTS PARTITION(ds='$ds')
|
|
|
|""".stripMargin)
|