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 2019/04/01 06:31:40 UTC

[GitHub] [spark] MaxGekk commented on a change in pull request #24249: [SPARK-27325][SQL] Add implicit encoders for LocalDate and Instant

MaxGekk 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_r270728884
 
 

 ##########
 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:
   >  It seems that we support these types in java bean field, too. 
   
   Actually I haven't checked that. I would add separate tests to `JavaBeanDeserializationSuite` together with the comment but this is not the target of the PR.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org