cloud-fan commented on a change in pull request #25242: [SPARK-28497][SQL] Disallow upcasting complex data types to string type URL: https://github.com/apache/spark/pull/25242#discussion_r307097063
########## File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/EncoderResolutionSuite.scala ########## @@ -196,6 +196,43 @@ class EncoderResolutionSuite extends PlanTest { encoder.resolveAndBind(attrs) } + test("SPARK-28497: complex type is not compatible with string encoder schema") { + val encoder = ExpressionEncoder[String] + + { + val attrs = Seq('a.struct('x.long)) + assert(intercept[AnalysisException](encoder.resolveAndBind(attrs)).message == + s""" Review comment: +1 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org