浏览代码

fix: phoenix转换

许家凯 3 年之前
父节点
当前提交
a581aab5d0
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/main/scala/com/winhc/bigdata/spark/implicits/PhoenixHelper.scala

+ 5 - 0
src/main/scala/com/winhc/bigdata/spark/implicits/PhoenixHelper.scala

@@ -40,6 +40,11 @@ object PhoenixHelper {
       import org.apache.spark.sql.functions.col
       df.select(cols.map(column => col(column).cast("string")): _*).save2PhoenixByJDBC(tableName)
     }
+
+    def save2PhoenixByJDBCPro(tableName: String): Unit = {
+      import org.apache.spark.sql.functions.col
+      df.select(df.columns.map(column => col(column).cast("string")): _*).save2PhoenixByJDBC(tableName)
+    }
   }
 
 }