-
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 9 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 |
|---|---|---|
|
|
@@ -50,6 +50,9 @@ Spark SQL and DataFrames support the following data types: | |
| absolute point in time. | ||
| - `DateType`: Represents values comprising values of fields year, month and day, without a | ||
| time-zone. | ||
| * Calendar Interval type | ||
| - `CalendarIntervalType`: The data type representing calendar time intervals. The calendar time interval is stored | ||
| internally in two components: number of months and the number of microseconds. | ||
| * Complex types | ||
| - `ArrayType(elementType, containsNull)`: Represents values comprising a sequence of | ||
| elements with the type of `elementType`. `containsNull` is used to indicate if | ||
|
|
@@ -163,6 +166,13 @@ You can access them by doing | |
| DateType | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td> <b>CalendarIntervalType</b> </td> | ||
| <td> org.apache.spark.sql.types.CalendarInterval </td> | ||
| <td> | ||
| CalendarIntervalType | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td> <b>ArrayType</b> </td> | ||
| <td> scala.collection.Seq </td> | ||
|
|
@@ -298,6 +308,13 @@ please use factory methods provided in | |
| DataTypes.DateType | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td> <b>CalendarIntervalType</b> </td> | ||
| <td> org.apache.spark.sql.types.CalendarInterval </td> | ||
| <td> | ||
| CalendarIntervalType | ||
|
||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td> <b>ArrayType</b> </td> | ||
| <td> java.util.List </td> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ | |
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.spark.unsafe.types; | ||
| package org.apache.spark.sql.types; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.Locale; | ||
|
|
@@ -103,8 +103,7 @@ public static CalendarInterval fromCaseInsensitiveString(String s) { | |
| throw new IllegalArgumentException("Interval cannot be null or blank."); | ||
| } | ||
| String sInLowerCase = s.trim().toLowerCase(Locale.ROOT); | ||
| String interval = | ||
| sInLowerCase.startsWith("interval ") ? sInLowerCase : "interval " + sInLowerCase; | ||
| String interval = sInLowerCase.startsWith("interval ") ? sInLowerCase : "interval " + sInLowerCase; | ||
|
||
| CalendarInterval cal = fromString(interval); | ||
| if (cal == null) { | ||
| throw new IllegalArgumentException("Invalid interval: " + s); | ||
|
|
||
| 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, one word,
CalendarIntervalinstead ofCalendar Interval?