AngersZhuuuu commented on a change in pull request #33518:
URL: https://github.com/apache/spark/pull/33518#discussion_r677144522
##########
File path: docs/sql-ref-datatypes.md
##########
@@ -49,6 +49,37 @@ 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.
+* 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]`,
+ - YEAR, years in the range `[0..178956970]`.
+
+ Individual interval fields are non-negative, but an interval itself can
have a sign, and be negative.
+
+ `startField` is the leftmost field, and `endField` is the rightmost field
of the type. Valid values of `startField` and `endField` are 0(MONTH) and
1(YEAR). Supported year-month interval types are:
+ - `YearMonthIntervalType(YEAR, YEAR)` or `YearMonthIntervalType(YEAR)`.
For instance, a value of the type is `INTERVAL '2021' YEAR`.
+ - `YearMonthIntervalType(YEAR, MONTH)`. For instance, a value of the
type is `INTERVAL '2021-07' YEAR TO MONTH`.
+ - `YearMonthIntervalType(MONTH, MONTH)` or
`YearMonthIntervalType(MONTH)`. For example, `INTERVAL '10' MONTH` is a value
of the type.
Review comment:
Use same `For example` or `For instance`?
##########
File path: docs/sql-ref-datatypes.md
##########
@@ -49,6 +49,37 @@ 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.
+* 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]`,
+ - YEAR, years in the range `[0..178956970]`.
+
+ Individual interval fields are non-negative, but an interval itself can
have a sign, and be negative.
+
+ `startField` is the leftmost field, and `endField` is the rightmost field
of the type. Valid values of `startField` and `endField` are 0(MONTH) and
1(YEAR). Supported year-month interval types are:
+ - `YearMonthIntervalType(YEAR, YEAR)` or `YearMonthIntervalType(YEAR)`.
For instance, a value of the type is `INTERVAL '2021' YEAR`.
+ - `YearMonthIntervalType(YEAR, MONTH)`. For instance, a value of the
type is `INTERVAL '2021-07' YEAR TO MONTH`.
+ - `YearMonthIntervalType(MONTH, MONTH)` or
`YearMonthIntervalType(MONTH)`. For example, `INTERVAL '10' MONTH` is a value
of the type.
+ - `DayTimeIntervalType(startField, endField)`: Represents a day-time
interval which is made up of a contiguous subset of the following fields:
+ - SECOND, seconds within minutes and possibly fractions of a second
[0..59.999999],
Review comment:
`[0..59.999999]` to keep consistence? also below such value.
##########
File path: docs/sql-ref-datatypes.md
##########
@@ -49,6 +49,37 @@ 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.
+* 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]`,
+ - YEAR, years in the range `[0..178956970]`.
+
+ Individual interval fields are non-negative, but an interval itself can
have a sign, and be negative.
+
+ `startField` is the leftmost field, and `endField` is the rightmost field
of the type. Valid values of `startField` and `endField` are 0(MONTH) and
1(YEAR). Supported year-month interval types are:
+ - `YearMonthIntervalType(YEAR, YEAR)` or `YearMonthIntervalType(YEAR)`.
For instance, a value of the type is `INTERVAL '2021' YEAR`.
+ - `YearMonthIntervalType(YEAR, MONTH)`. For instance, a value of the
type is `INTERVAL '2021-07' YEAR TO MONTH`.
+ - `YearMonthIntervalType(MONTH, MONTH)` or
`YearMonthIntervalType(MONTH)`. For example, `INTERVAL '10' MONTH` is a value
of the type.
+ - `DayTimeIntervalType(startField, endField)`: Represents a day-time
interval which is made up of a contiguous subset of the following fields:
+ - SECOND, seconds within minutes and possibly fractions of a second
[0..59.999999],
+ - MINUTE, minutes within hours [0..59],
+ - HOUR, hours within days [0..23],
+ - DAY, days in the range [0..106751991].
+
+ Individual interval fields are non-negative, but an interval itself can
have a sign, and be negative.
+
+ `startField` is the leftmost field, and `endField` is the rightmost field
of the type. Valid values of `startField` and `endField` are 0 (DAY), 1 (HOUR),
2 (MINUTE), 3 (SECOND). Supported day-time interval types are:
+ - `DayTimeIntervalType(DAY, DAY)` or `DayTimeIntervalType(DAY)`. For
instance, `INTERVAL '100' DAY`.
Review comment:
Also for example value part we can keep same? Use same `For example` or
`For instance`?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]