You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wish we can support count on Struct of Map(String,String).
For example:
import org.apache.spark.sql.Row
import org.apache.spark.sql.types._
val data = Seq(
Row("Adam",Map("hair"->"black","eye"->"black"), Row("address" , Map("state"->"CA"),Map("city"->"santa clara"))),
Row("Bob",Map("hair"->"red","eye"->"red"),Row("address", Map("state"->"GA"),Map("city"->"abc"))),
Row("Cathy",Map("hair"->"blue","eye"->"blue"),Row("address",Map("state"->"NC"),Map("city"->"xyz")))
)
val mapType = DataTypes.createMapType(StringType,StringType)
val schema = new StructType().add("name",StringType).add("properties", mapType).add("prop2", new StructType().add("propname",StringType).add("address", mapType).add("address2", mapType))
val mapTypeDF = spark.createDataFrame(spark.sparkContext.parallelize(data),schema)
mapTypeDF.write.format("parquet").mode("overwrite").save("/tmp/testparquet")
val df1 = spark.read.parquet("/tmp/testparquet")
df1.createOrReplaceTempView("df1")
df1.printSchema
spark.sql("SELECT count(prop2) FROM df1").collect()
Not-supported messages:
!Expression <Count> count(prop2#228) cannot run on GPU because input expression AttributeReference prop2#228 (child MapType(StringType,StringType,true) is not supported, child MapType(StringType,StringType,true) is not supported)
The text was updated successfully, but these errors were encountered:
I wish we can support count on Struct of Map(String,String).
For example:
Not-supported messages:
The text was updated successfully, but these errors were encountered: