Schema 如下:
|-- list: array (nullable = true)
| |-- element: map (containsNull = true)
| | |-- key: string
| | |-- value: array (valueContainsNull = true)
| | | |-- element: struct (containsNull = true)
| | | | |-- Date: integer (nullable = true)
| | | | |-- Name: string (nullable = true)
|-- list2: array (nullable = true)
| |-- element: map (containsNull = true)
| | |-- key: string
| | |-- value: array (valueContainsNull = true)
| | | |-- element: struct (containsNull = true)
| | | | |-- Date: integer (nullable = true)
| | | | |-- Name: string (nullable = true)
想过滤出来 list 和 list2 相等的数据,该如何判断?
使用filter($"list" === $"list2")
判断会提示错误:
org.apache.spark.sql.AnalysisException: cannot resolve '(`list` = `list2`)' due to data type mismatch: Cannot use map type in EqualTo, but the actual input type is array<map<string,array<str
uct<Date:int,Name:string>>>>.;;
以上,感谢~
1
linuxchild OP 木有人搞么
|
2
MasterC 2017-11-24 11:43:26 +08:00
自己写 function 进行遍历比较
|
3
czheo 2017-11-24 11:45:35 +08:00
udf
|
4
linuxchild OP |