List1 = (" data center best practice design","essentials advantage","technical and business solution")
List2 = ("data center best","essentials","data","data center","capture","mssp umbrella")
使用Spark-scala的输出:
List_output = ("data center best","essentials","data","data center")
答案 0 :(得分:1)
您可以使用以下内容。
val list_output = parentList filter (childList.toSet)
答案 1 :(得分:0)
val List_output = List2.filter(p => List1.exists(e => e.matches(s“ $ p。*”)))