Scala 在MapType为的数据帧上使用except时引发错误
我发现在使用Spark MapType时,DataFrame中不能有调用set操作的映射类型列 下面是我为复制它而编写的示例代码。我理解这是因为MapType对象是不可散列的,但我有一个用例需要执行以下操作Scala 在MapType为的数据帧上使用except时引发错误,scala,apache-spark,apache-spark-sql,Scala,Apache Spark,Apache Spark Sql,我发现在使用Spark MapType时,DataFrame中不能有调用set操作的映射类型列 下面是我为复制它而编写的示例代码。我理解这是因为MapType对象是不可散列的,但我有一个用例需要执行以下操作 val schema1 = StructType(Seq( StructField("a", MapType(StringType, StringType, true)), StructField("b", StringTy
val schema1 = StructType(Seq(
StructField("a", MapType(StringType, StringType, true)),
StructField("b", StringType, true)
))
val df = spark.read.schema(schema1).json("path")
val filteredDF = df.filter($"b" === "apple")
val otherDF = df.except(filteredDF)
有什么解决方法的建议吗?为什么不
val filteredDF=df.filter($“b”==“apple”)
和val otherDF=df.filter($“b”!=“apple”)
??