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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]