使用复杂类型查询SparkSQLDataFrame
case class Test(name: String, map: Map[String, String])val map = Map("hello" -> "world", "hey" -> "there")val map2 = Map("hello" -> "people", "hey" -> "you")val rdd = sc.parallelize(Array(Test("first", map), Test("second", map2)))
sqlContext.sql("SELECT * FROM rdd WHERE map.hello = world")
sqlContext.sql("SELECT * FROM rdd WHERE map[hello] = world")
无法访问MapType类型中的嵌套字段(StringType,true)
org.apache.spark.sql.catalyst.errors.package$TreeNodeException:未解析属性
相关分类