Skip to content

Commit 31a0cd7

Browse files
committed
the alternative Encoder type shall be Encoder[Map[String, Any]]
1 parent 59f6edf commit 31a0cd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/src/main/scala/org/apache/spark/examples/sql/SparkSQLExample.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ object SparkSQLExample {
203203
// No pre-defined encoders for Dataset[Map[K,V]], define explicitly
204204
implicit val mapEncoder = org.apache.spark.sql.Encoders.kryo[Map[String, Any]]
205205
// Primitive types and case classes can be also defined as
206-
implicit val stringIntMapEncoder: Encoder[Map[String, Int]] = ExpressionEncoder()
206+
implicit val stringIntMapEncoder: Encoder[Map[String, Any]] = ExpressionEncoder()
207207

208208
// row.getValuesMap[T] retrieves multiple columns at once into a Map[String, T]
209209
teenagersDF.map(teenager => teenager.getValuesMap[Any](List("name", "age"))).collect()

0 commit comments

Comments
 (0)