-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-42430][SQL][DOC] Add documentation for TimestampNTZ type #40005
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,11 +44,15 @@ Spark SQL and DataFrames support the following data types: | |
| * Boolean type | ||
| - `BooleanType`: Represents boolean values. | ||
| * Datetime type | ||
| - `TimestampType`: Represents values comprising values of fields year, month, day, | ||
| hour, minute, and second, with the session local time-zone. The timestamp value represents an | ||
| absolute point in time. | ||
| - `DateType`: Represents values comprising values of fields year, month and day, without a | ||
| time-zone. | ||
| - `TimestampType`: Timestamp with local time zone(TIMESTAMP_LTZ). It represents values comprising values of fields year, month, day, | ||
| hour, minute, and second, with the session local time-zone. The timestamp value represents an | ||
| absolute point in time. | ||
| - `TimestampNTZType`: Timestamp without time zone(TIMESTAMP_NTZ). It represents values comprising values of fields year, month, day, | ||
| hour, minute, and second. All operations are performed without taking any time zone into account. | ||
| - Note: TIMESTAMP in Spark is a user-specified alias associated with one of the TIMESTAMP_LTZ and TIMESTAMP_NTZ variations. Users can set the default timestamp type as `TIMESTAMP_LTZ`(default value) or `TIMESTAMP_NTZ` via the configuration `spark.sql.timestampType`. | ||
|
|
||
| * Interval types | ||
| - `YearMonthIntervalType(startField, endField)`: Represents a year-month interval which is made up of a contiguous subset of the following fields: | ||
| - MONTH, months within years `[0..11]`, | ||
|
|
@@ -124,6 +128,7 @@ You can access them by doing | |
| |**BinaryType**|Array[Byte]|BinaryType| | ||
| |**BooleanType**|Boolean|BooleanType| | ||
| |**TimestampType**|java.sql.Timestamp|TimestampType| | ||
| |**TimestampNTZType**|java.time.LocalDateTime| TimestampNTZType| | ||
| |**DateType**|java.sql.Date|DateType| | ||
| |**YearMonthIntervalType**|java.time.Period|YearMonthIntervalType| | ||
| |**DayTimeIntervalType**|java.time.Duration|DayTimeIntervalType| | ||
|
|
@@ -154,6 +159,7 @@ please use factory methods provided in | |
| |**BinaryType**|byte[]|DataTypes.BinaryType| | ||
| |**BooleanType**|boolean or Boolean|DataTypes.BooleanType| | ||
| |**TimestampType**|java.sql.Timestamp|DataTypes.TimestampType| | ||
| |**TimestampNTZType**|java.time.LocalDateTime| TimestampNTZType| | ||
| |**DateType**|java.sql.Date|DataTypes.DateType| | ||
| |**YearMonthIntervalType**|java.time.Period|YearMonthIntervalType| | ||
| |**DayTimeIntervalType**|java.time.Duration|DayTimeIntervalType| | ||
|
|
@@ -185,6 +191,7 @@ from pyspark.sql.types import * | |
| |**BinaryType**|bytearray|BinaryType()| | ||
| |**BooleanType**|bool|BooleanType()| | ||
| |**TimestampType**|datetime.datetime|TimestampType()| | ||
| |**TimestampNTZType**|datetime.datetime|TimestampNTZType()| | ||
|
Member
Author
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. cc @HyukjinKwon on this one. |
||
| |**DateType**|datetime.date|DateType()| | ||
| |**DayTimeIntervalType**|datetime.timedelta|DayTimeIntervalType()| | ||
| |**ArrayType**|list, tuple, or array|ArrayType(*elementType*, [*containsNull*])<br/>**Note:**The default value of *containsNull* is True.| | ||
|
|
@@ -231,7 +238,8 @@ The following table shows the type names as well as aliases used in Spark SQL pa | |
| |**FloatType**|FLOAT, REAL| | ||
| |**DoubleType**|DOUBLE| | ||
| |**DateType**|DATE| | ||
| |**TimestampType**|TIMESTAMP| | ||
| |**TimestampType**|TIMESTAMP, TIMESTAMP_LTZ| | ||
| |**TimestampNTZType**|TIMESTAMP_NTZ| | ||
| |**StringType**|STRING| | ||
| |**BinaryType**|BINARY| | ||
| |**DecimalType**|DECIMAL, DEC, NUMERIC| | ||
|
|
||
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.
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.
nit: seems all others are prefixed by
DataTypes.