You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/03/09 07:19:47 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #35756: [SPARK-38437][SQL] Lenient serialization of datetime from datasource
cloud-fan commented on a change in pull request #35756:
URL: https://github.com/apache/spark/pull/35756#discussion_r822349667
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala
##########
@@ -66,23 +66,27 @@ import org.apache.spark.sql.types._
* }}}
*/
object RowEncoder {
- def apply(schema: StructType): ExpressionEncoder[Row] = {
+ def apply(schema: StructType, lenient: Boolean): ExpressionEncoder[Row] = {
val cls = classOf[Row]
val inputObject = BoundReference(0, ObjectType(cls), nullable = true)
- val serializer = serializerFor(inputObject, schema)
+ val serializer = serializerFor(inputObject, schema, lenient)
val deserializer = deserializerFor(GetColumnByOrdinal(0, serializer.dataType), schema)
new ExpressionEncoder[Row](
serializer,
deserializer,
ClassTag(cls))
}
+ def apply(schema: StructType): ExpressionEncoder[Row] = {
Review comment:
nit: put a blank line between methods.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org