Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ trait TimeZoneAwareExpression extends Expression {
* There is no code generation since this expression should get constant folded by the optimizer.
*/
@ExpressionDescription(
usage = "_FUNC_() - Returns the current date at the start of query evaluation.")
usage = "_FUNC_() - Returns the current date at the start of query evaluation.",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8192 - date/time function: current_date. 1.5.0

case class CurrentDate(timeZoneId: Option[String] = None)
extends LeafExpression with TimeZoneAwareExpression with CodegenFallback {

Expand Down Expand Up @@ -81,7 +82,8 @@ case class CurrentDate(timeZoneId: Option[String] = None)
* There is no code generation since this expression should get constant folded by the optimizer.
*/
@ExpressionDescription(
usage = "_FUNC_() - Returns the current timestamp at the start of query evaluation.")
usage = "_FUNC_() - Returns the current timestamp at the start of query evaluation.",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8193 - date/time function: current_timestamp. 1.5.0

case class CurrentTimestamp() extends LeafExpression with CodegenFallback {
override def foldable: Boolean = true
override def nullable: Boolean = false
Expand Down Expand Up @@ -141,7 +143,8 @@ case class CurrentBatchTimestamp(
Examples:
> SELECT _FUNC_('2016-07-30', 1);
2016-07-31
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8186 - date/time function: date_add. 1.5.0

case class DateAdd(startDate: Expression, days: Expression)
extends BinaryExpression with ImplicitCastInputTypes {

Expand Down Expand Up @@ -174,7 +177,8 @@ case class DateAdd(startDate: Expression, days: Expression)
Examples:
> SELECT _FUNC_('2016-07-30', 1);
2016-07-29
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8187 - date/time function: date_sub. 1.5.0

case class DateSub(startDate: Expression, days: Expression)
extends BinaryExpression with ImplicitCastInputTypes {
override def left: Expression = startDate
Expand Down Expand Up @@ -203,7 +207,8 @@ case class DateSub(startDate: Expression, days: Expression)
Examples:
> SELECT _FUNC_('2009-07-30 12:58:59');
12
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8181 - date/time function: hour. 1.5.0

case class Hour(child: Expression, timeZoneId: Option[String] = None)
extends UnaryExpression with TimeZoneAwareExpression with ImplicitCastInputTypes {

Expand Down Expand Up @@ -233,7 +238,8 @@ case class Hour(child: Expression, timeZoneId: Option[String] = None)
Examples:
> SELECT _FUNC_('2009-07-30 12:58:59');
58
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8182 - date/time function: minute. 1.5.0

case class Minute(child: Expression, timeZoneId: Option[String] = None)
extends UnaryExpression with TimeZoneAwareExpression with ImplicitCastInputTypes {

Expand Down Expand Up @@ -263,7 +269,8 @@ case class Minute(child: Expression, timeZoneId: Option[String] = None)
Examples:
> SELECT _FUNC_('2009-07-30 12:58:59');
59
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8183 - date/time function: second. 1.5.0

case class Second(child: Expression, timeZoneId: Option[String] = None)
extends UnaryExpression with TimeZoneAwareExpression with ImplicitCastInputTypes {

Expand Down Expand Up @@ -293,7 +300,8 @@ case class Second(child: Expression, timeZoneId: Option[String] = None)
Examples:
> SELECT _FUNC_('2016-04-09');
100
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-9115 - date/time function: dayInYear. 1.5.0

case class DayOfYear(child: Expression) extends UnaryExpression with ImplicitCastInputTypes {

override def inputTypes: Seq[AbstractDataType] = Seq(DateType)
Expand All @@ -316,7 +324,8 @@ case class DayOfYear(child: Expression) extends UnaryExpression with ImplicitCas
Examples:
> SELECT _FUNC_('2016-07-30');
2016
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8177 - date/time function: year. 1.5.0

case class Year(child: Expression) extends UnaryExpression with ImplicitCastInputTypes {

override def inputTypes: Seq[AbstractDataType] = Seq(DateType)
Expand All @@ -339,7 +348,8 @@ case class Year(child: Expression) extends UnaryExpression with ImplicitCastInpu
Examples:
> SELECT _FUNC_('2016-08-31');
3
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8178 - date/time function: quarter. 1.5.0

case class Quarter(child: Expression) extends UnaryExpression with ImplicitCastInputTypes {

override def inputTypes: Seq[AbstractDataType] = Seq(DateType)
Expand All @@ -362,7 +372,8 @@ case class Quarter(child: Expression) extends UnaryExpression with ImplicitCastI
Examples:
> SELECT _FUNC_('2016-07-30');
7
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8179 - date/time function: month. 1.5.0

case class Month(child: Expression) extends UnaryExpression with ImplicitCastInputTypes {

override def inputTypes: Seq[AbstractDataType] = Seq(DateType)
Expand All @@ -385,7 +396,8 @@ case class Month(child: Expression) extends UnaryExpression with ImplicitCastInp
Examples:
> SELECT _FUNC_('2009-07-30');
30
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8180 - date/time function: day / dayofmonth. 1.5.0

case class DayOfMonth(child: Expression) extends UnaryExpression with ImplicitCastInputTypes {

override def inputTypes: Seq[AbstractDataType] = Seq(DateType)
Expand All @@ -409,7 +421,8 @@ case class DayOfMonth(child: Expression) extends UnaryExpression with ImplicitCa
Examples:
> SELECT _FUNC_('2009-07-30');
5
""")
""",
since = "2.3.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-20909 - Build-in SQL Function Support - DAYOFWEEK. 2.3.0

// scalastyle:on line.size.limit
case class DayOfWeek(child: Expression) extends UnaryExpression with ImplicitCastInputTypes {

Expand Down Expand Up @@ -447,7 +460,8 @@ case class DayOfWeek(child: Expression) extends UnaryExpression with ImplicitCas
Examples:
> SELECT _FUNC_('2008-02-20');
8
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8184 - date/time function: weekofyear. 1.5.0

// scalastyle:on line.size.limit
case class WeekOfYear(child: Expression) extends UnaryExpression with ImplicitCastInputTypes {

Expand Down Expand Up @@ -493,7 +507,8 @@ case class WeekOfYear(child: Expression) extends UnaryExpression with ImplicitCa
Examples:
> SELECT _FUNC_('2016-04-08', 'y');
2016
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8199 - date/time function: date_format

// scalastyle:on line.size.limit
case class DateFormatClass(left: Expression, right: Expression, timeZoneId: Option[String] = None)
extends BinaryExpression with TimeZoneAwareExpression with ImplicitCastInputTypes {
Expand Down Expand Up @@ -534,7 +549,8 @@ case class DateFormatClass(left: Expression, right: Expression, timeZoneId: Opti
Examples:
> SELECT _FUNC_('2016-04-08', 'yyyy-MM-dd');
1460041200
""")
""",
since = "1.6.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-11396 - datetime function: to_unix_timestamp. 1.6.0

case class ToUnixTimestamp(
timeExp: Expression,
format: Expression,
Expand Down Expand Up @@ -574,7 +590,8 @@ case class ToUnixTimestamp(
1476884637
> SELECT _FUNC_('2016-04-08', 'yyyy-MM-dd');
1460041200
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8174 - date/time function: unix_timestamp. 1.5.0

case class UnixTimestamp(timeExp: Expression, format: Expression, timeZoneId: Option[String] = None)
extends UnixTime {

Expand Down Expand Up @@ -724,7 +741,8 @@ abstract class UnixTime
Examples:
> SELECT _FUNC_(0, 'yyyy-MM-dd HH:mm:ss');
1970-01-01 00:00:00
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8175 - date/time function: from_unixtime. 1.5.0

case class FromUnixTime(sec: Expression, format: Expression, timeZoneId: Option[String] = None)
extends BinaryExpression with TimeZoneAwareExpression with ImplicitCastInputTypes {

Expand Down Expand Up @@ -833,7 +851,8 @@ case class FromUnixTime(sec: Expression, format: Expression, timeZoneId: Option[
Examples:
> SELECT _FUNC_('2009-01-12');
2009-01-31
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8195 - date/time function: last_day. 1.5.0

case class LastDay(startDate: Expression) extends UnaryExpression with ImplicitCastInputTypes {
override def child: Expression = startDate

Expand Down Expand Up @@ -867,7 +886,8 @@ case class LastDay(startDate: Expression) extends UnaryExpression with ImplicitC
Examples:
> SELECT _FUNC_('2015-01-14', 'TU');
2015-01-20
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8196 - date/time function: next_day. 1.5.0

// scalastyle:on line.size.limit
case class NextDay(startDate: Expression, dayOfWeek: Expression)
extends BinaryExpression with ImplicitCastInputTypes {
Expand Down Expand Up @@ -968,7 +988,8 @@ case class TimeAdd(start: Expression, interval: Expression, timeZoneId: Option[S
Examples:
> SELECT from_utc_timestamp('2016-08-31', 'Asia/Seoul');
2016-08-31 09:00:00
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8188 - date/time function: from_utc_timestamp 1.5.0

// scalastyle:on line.size.limit
case class FromUTCTimestamp(left: Expression, right: Expression)
extends BinaryExpression with ImplicitCastInputTypes {
Expand Down Expand Up @@ -1061,7 +1082,8 @@ case class TimeSub(start: Expression, interval: Expression, timeZoneId: Option[S
Examples:
> SELECT _FUNC_('2016-08-31', 1);
2016-09-30
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8194 - date/time function: add_months. 1.5.0

// scalastyle:on line.size.limit
case class AddMonths(startDate: Expression, numMonths: Expression)
extends BinaryExpression with ImplicitCastInputTypes {
Expand Down Expand Up @@ -1097,7 +1119,8 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
Examples:
> SELECT _FUNC_('1997-02-28 10:30:00', '1996-10-30');
3.94959677
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8198 - date/time function: months_between. 1.5.0

// scalastyle:on line.size.limit
case class MonthsBetween(date1: Expression, date2: Expression, timeZoneId: Option[String] = None)
extends BinaryExpression with TimeZoneAwareExpression with ImplicitCastInputTypes {
Expand Down Expand Up @@ -1140,7 +1163,8 @@ case class MonthsBetween(date1: Expression, date2: Expression, timeZoneId: Optio
Examples:
> SELECT _FUNC_('2016-08-31', 'Asia/Seoul');
2016-08-30 15:00:00
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8191 - date/time function: to_utc_timestamp. 1.5.0

// scalastyle:on line.size.limit
case class ToUTCTimestamp(left: Expression, right: Expression)
extends BinaryExpression with ImplicitCastInputTypes {
Expand Down Expand Up @@ -1203,7 +1227,8 @@ case class ToUTCTimestamp(left: Expression, right: Expression)
2009-07-30
> SELECT _FUNC_('2016-12-31', 'yyyy-MM-dd');
2016-12-31
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8176 - date/time function: to_date. 1.5.0

case class ParseToDate(left: Expression, format: Option[Expression], child: Expression)
extends RuntimeReplaceable {

Expand Down Expand Up @@ -1244,7 +1269,8 @@ case class ParseToDate(left: Expression, format: Option[Expression], child: Expr
2016-12-31 00:12:00
> SELECT _FUNC_('2016-12-31', 'yyyy-MM-dd');
2016-12-31 00:00:00
""")
""",
since = "2.2.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-16609 - Single function for parsing timestamps/dates. 2.2.0

case class ParseToTimestamp(left: Expression, format: Option[Expression], child: Expression)
extends RuntimeReplaceable {

Expand Down Expand Up @@ -1279,7 +1305,8 @@ case class ParseToTimestamp(left: Expression, format: Option[Expression], child:
2009-02-01
> SELECT _FUNC_('2015-10-27', 'YEAR');
2015-01-01
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8197 - date/time function: trunc. 1.5.0

// scalastyle:on line.size.limit
case class TruncDate(date: Expression, format: Expression)
extends BinaryExpression with ImplicitCastInputTypes {
Expand Down Expand Up @@ -1359,7 +1386,8 @@ case class TruncDate(date: Expression, format: Expression)

> SELECT _FUNC_('2009-07-30', '2009-07-31');
-1
""")
""",
since = "1.5.0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/SPARK-8185 - date/time function: datediff. 1.5.0

case class DateDiff(endDate: Expression, startDate: Expression)
extends BinaryExpression with ImplicitCastInputTypes {

Expand Down