-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24695][SQL] Move CalendarInterval to org.apache.spark.sql.types package
#25022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
e018e84
bdb800e
44199dc
d6decb2
42b9ca4
6e69027
01f6e87
1d704ee
5330fcf
97e73b0
81c37cd
1353ddd
1b297e1
0d33e22
a07c79f
e00c0dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ import scala.util.hashing.MurmurHash3 | |
|
|
||
| import org.apache.spark.annotation.Stable | ||
| import org.apache.spark.sql.catalyst.expressions.GenericRow | ||
| import org.apache.spark.sql.types.StructType | ||
| import org.apache.spark.sql.types.{CalendarInterval, StructType} | ||
|
|
||
| /** | ||
| * @since 1.3.0 | ||
|
|
@@ -159,6 +159,7 @@ trait Row extends Serializable { | |
| * ArrayType -> scala.collection.Seq (use getList for java.util.List) | ||
| * MapType -> scala.collection.Map (use getJavaMap for java.util.Map) | ||
| * StructType -> org.apache.spark.sql.Row | ||
| * CalendarIntervalType -> org.apache.spark.sql.types.CalendarInterval | ||
| * }}} | ||
| */ | ||
| def apply(i: Int): Any = get(i) | ||
|
|
@@ -184,6 +185,7 @@ trait Row extends Serializable { | |
| * ArrayType -> scala.collection.Seq (use getList for java.util.List) | ||
| * MapType -> scala.collection.Map (use getJavaMap for java.util.Map) | ||
| * StructType -> org.apache.spark.sql.Row | ||
| * CalendarIntervalType -> org.apache.spark.sql.types.CalendarInterval | ||
| * }}} | ||
| */ | ||
| def get(i: Int): Any | ||
|
|
@@ -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) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure I follow. Shouldn't this be a |
||
|
|
||
| /** | ||
| * Returns the value at position i. | ||
| * For primitive types if value is null it returns 'zero value' specific for primitive | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,8 @@ import org.apache.spark.sql.catalyst.util._ | |
| import org.apache.spark.sql.catalyst.util.DateTimeUtils.instantToMicros | ||
| import org.apache.spark.sql.internal.SQLConf | ||
| import org.apache.spark.sql.types._ | ||
| import org.apache.spark.unsafe.types._ | ||
|
|
||
|
||
| import org.apache.spark.unsafe.types.UTF8String | ||
| import org.apache.spark.util.Utils | ||
|
|
||
| object Literal { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.