[ https://issues.apache.org/jira/browse/SPARK-49789?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated SPARK-49789: ----------------------------------- Labels: pull-request-available spark-sql (was: spark-sql) > org.apache.spark.SparkUnsupportedOperationException: [ENCODER_NOT_FOUND] Not > found an encoder of the type T > ----------------------------------------------------------------------------------------------------------- > > Key: SPARK-49789 > URL: https://issues.apache.org/jira/browse/SPARK-49789 > Project: Spark > Issue Type: Bug > Components: Connect, SQL > Affects Versions: 4.0.0, 3.5.2 > Reporter: Asif > Priority: Major > Labels: pull-request-available, spark-sql > > If a Bean class is having a generic type T as a bean property and T has > upper bound of Serializable, i.e T <: Serializable , spark should allow > creation of an Encoder, treating T as a binary field. > Currently it throws following exception > > org.apache.spark.SparkUnsupportedOperationException: [ENCODER_NOT_FOUND] Not > found an encoder of the type T to Spark SQL internal representation. Consider > to change the input type to one of supported at > '[https://spark.apache.org/docs/latest/sql-ref-datatypes.html'|https://spark.apache.org/docs/latest/sql-ref-datatypes.html']. > at > org.apache.spark.sql.errors.QueryExecutionErrors$.cannotFindEncoderForTypeError(QueryExecutionErrors.scala:1483) > at > org.apache.spark.sql.catalyst.JavaTypeInference$.encoderFor(JavaTypeInference.scala:142) > at > org.apache.spark.sql.catalyst.JavaTypeInference$.$anonfun$encoderFor$1(JavaTypeInference.scala:128) > at > scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286) > at > scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36) > at > scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33) > at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:198) > at scala.collection.TraversableLike.map(TraversableLike.scala:286) > at scala.collection.TraversableLike.map$(TraversableLike.scala:279) > at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:198) > at > org.apache.spark.sql.catalyst.JavaTypeInference$.encoderFor(JavaTypeInference.scala:126) > at > org.apache.spark.sql.catalyst.JavaTypeInference$.encoderFor(JavaTypeInference.scala:58) > at > org.apache.spark.sql.catalyst.JavaTypeInference$.encoderFor(JavaTypeInference.scala:51) > at > org.apache.spark.sql.catalyst.encoders.ExpressionEncoder$.javaBean(ExpressionEncoder.scala:62) > at org.apache.spark.sql.Encoders$.bean(Encoders.scala:179) -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org