-
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
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e018e84
SPARK-24695: To add support to return Calender interval from udf.
priyankagar bdb800e
SPARK-24695: To incorporate review comments
priyankagar 44199dc
Delete CalendarIntervalSuite.java
priyankagargnitk d6decb2
SPARK-24695: To incorporate review comments
priyankagar 42b9ca4
Revert "SPARK-24695: To incorporate review comments"
priyankagar 6e69027
SPARK-24695: To incorporate review comments
priyankagar 01f6e87
SPARK-24695: To incorporate review comments
priyankagar 1d704ee
SPARK-24695: To incorporate review comments
priyankagar 5330fcf
SPARK-24695: To incorporate documentation changes
priyankagar 97e73b0
SPARK-24695: To add review comments
priyankagar 81c37cd
SPARK-24695: To incorporate review comments
priyankagar 1353ddd
Merge branch 'master' of github.com:apache/spark into SPARK--24695
priyankagar 1b297e1
SPARK-24695: To incorporate review comments
priyankagar 0d33e22
SPARK-24695: To add review comments
priyankagar a07c79f
SPARK-24695: To fix failing test cases
priyankagar e00c0dc
SPARK-24695: To fix failing test cases
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.