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/08/01 19:04:17 UTC

[GitHub] [spark] hvanhovell commented on a change in pull request #25022: [SPARK-24695][SQL] Move `CalendarInterval` to org.apache.spark.sql.types package

hvanhovell commented on a change in pull request #25022: [SPARK-24695][SQL] Move `CalendarInterval` to org.apache.spark.sql.types package
URL: https://github.com/apache/spark/pull/25022#discussion_r309852018
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala
 ##########
 @@ -327,6 +329,14 @@ trait Row extends Serializable {
    */
   def getStruct(i: Int): Row = getAs[Row](i)
 
+  /**
+   * Returns value at position i of calendar Interval type as a
+   * [[org.apache.spark.sql.types.CalendarInterval]] object.
+   *
+   * @throws ClassCastException when data type does not match.
+   */
+  def getCalendarInterval(i: Int): CalendarInterval = CalendarInterval.fromString(get(i).toString)
 
 Review comment:
   I am not sure I follow. Shouldn't this be a `CalendarInterval`? Or some java interval type? It seems a bit weird to make this public and put a string in a Row instead of the actual type.

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