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
解決:修改第二個引數的賦值邏輯即可!
相關文章
- String,String Builder,String Buffer-原始碼UI原始碼
- spring getBean(String) No bean named '' is definedSpringBean
- String a = "abc" 與String b = new String("abc")的區別
- java.lang.String 與stringJava
- String
- String s = “hello“和String s = new String(“hello“)的區別
- Oracle replace function to delete sub-stringOracleFunctiondelete
- 【JDK】分析 String str=““ 與 new String()JDK
- rust 中 str 與 String; &str &StringRust
- [JAVA]toString()、String.valueOf()、(String)Java
- ${string::N}和${string:N}字元提取字元
- 轉換String三種方式比較:toString()、String.valueOf()、(String)
- C#中String和string區別C#
- String字串字串
- JavaScript String()JavaScript
- string 字串字串
- ES 筆記十:Query String & Simple Query String筆記
- String str=null; 和String str=""的區別Null
- java 常用類-String-1Java
- String s = new String(" a ") 到底產生幾個物件?物件
- PHP Fatal error: Cannot use PhpParser\Node\Scalar\String as StringPHPError
- String s=new String("abc")建立了幾個物件?物件
- Convert string to binary and binary to string in C#C#
- python stringPython
- Elasticsearch——query stringElasticsearch
- String筆記筆記
- python stringPython
- JavaScript String 字串JavaScript字串
- javascript-StringJavaScript
- Java String類Java
- Swift Int to StringSwift
- C# stringC#
- ORACLE escape stringOracle
- spring - stringSpring
- D - String Bags
- String 型別型別
- Dictionary<string, object>Object
- Redis之StringRedis