dongjoon-hyun commented on a change in pull request #24249: [SPARK-27325][SQL]
Add implicit encoders for LocalDate and Instant
URL: https://github.com/apache/spark/pull/24249#discussion_r270695230
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/Encoders.scala
##########
@@ -109,13 +109,29 @@ object Encoders {
*/
def DATE: Encoder[java.sql.Date] = ExpressionEncoder()
+ /**
+ * Creates an encoder that serializes instances of the `java.time.LocalDate`
class
+ * to the internal representation of nullable Catalyst's DateType.
+ *
+ * @since 3.0.0
+ */
+ def LOCALDATE: Encoder[java.time.LocalDate] = ExpressionEncoder()
+
/**
* An encoder for nullable timestamp type.
*
* @since 1.6.0
*/
def TIMESTAMP: Encoder[java.sql.Timestamp] = ExpressionEncoder()
+ /**
+ * Creates an encoder that serializes instances of the `java.time.Instant`
class
+ * to the internal representation of nullable Catalyst's TimestampType.
+ *
+ * @since 3.0.0
+ */
+ def INSTANT: Encoder[java.time.Instant] = ExpressionEncoder()
+
Review comment:
@MaxGekk . It seems that we support these types in java bean field, too. Can
we add these after line 152 of this file?
-
https://github.com/apache/spark/pull/24249/files#diff-3e88c21c9270fef6eaf6f0e64ed81f27R152
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]