Failed to execute user defined function(anonfun$concatStr$1: (map<string,string>, string) => string)
自定義spark UDF函式如下:
def concatStr: UserDefinedFunction = udf((list: Map[String, String], key: String) => {
val param = list.getOrElse(key, "")
key.concat(param)
})
今天出現報錯資訊:
org.apache.spark.SparkException: Failed to execute user defined function(anonfun$concatStr$1: (map<string,string>, string) => string)
原因:不是函式的問題,而是呼叫函式時,傳入的第二個引數不是數值,而是 null
解決:修改第二個引數的賦值邏輯即可!
相關文章
- spring getBean(String) No bean named '' is definedSpringBean
- String,String Builder,String Buffer-原始碼UI原始碼
- String s = “hello“和String s = new String(“hello“)的區別
- String
- rust 中 str 與 String; &str &StringRust
- 【JDK】分析 String str=““ 與 new String()JDK
- 轉換String三種方式比較:toString()、String.valueOf()、(String)
- spring - stringSpring
- string 字串字串
- Date or String
- String …params
- String模板
- python stringPython
- python stringPython
- String字串字串
- String類
- string容器
- JavaScript String()JavaScript
- ES 筆記十:Query String & Simple Query String筆記
- Solidity String轉byte32 byte轉StringSolid
- Json,String,Map之間的轉換JSON
- String s = new String(" a ") 到底產生幾個物件?物件
- java 常用類-String-1Java
- String interpolation using $
- String 型別型別
- Check if String is HappyAPP
- D - String Bags
- Redis之StringRedis
- Dictionary<string, object>Object
- Java String類Java
- BigDecimal轉StringDecimal
- python character stringPython
- String筆記筆記
- string轉QBytearray
- [LeetCode] Rotate StringLeetCode
- [LintCode] Permutation in String
- String.fromCodePoint()
- Elasticsearch——query stringElasticsearch