@@ -53,7 +53,8 @@ trait TimeZoneAwareExpression extends Expression {
53
53
* There is no code generation since this expression should get constant folded by the optimizer.
54
54
*/
55
55
@ ExpressionDescription (
56
- usage = " _FUNC_() - Returns the current date at the start of query evaluation." )
56
+ usage = " _FUNC_() - Returns the current date at the start of query evaluation." ,
57
+ since = " 1.5.0" )
57
58
case class CurrentDate (timeZoneId : Option [String ] = None )
58
59
extends LeafExpression with TimeZoneAwareExpression with CodegenFallback {
59
60
@@ -81,7 +82,8 @@ case class CurrentDate(timeZoneId: Option[String] = None)
81
82
* There is no code generation since this expression should get constant folded by the optimizer.
82
83
*/
83
84
@ ExpressionDescription (
84
- usage = " _FUNC_() - Returns the current timestamp at the start of query evaluation." )
85
+ usage = " _FUNC_() - Returns the current timestamp at the start of query evaluation." ,
86
+ since = " 1.5.0" )
85
87
case class CurrentTimestamp () extends LeafExpression with CodegenFallback {
86
88
override def foldable : Boolean = true
87
89
override def nullable : Boolean = false
@@ -141,7 +143,8 @@ case class CurrentBatchTimestamp(
141
143
Examples:
142
144
> SELECT _FUNC_('2016-07-30', 1);
143
145
2016-07-31
144
- """ )
146
+ """ ,
147
+ since = " 1.5.0" )
145
148
case class DateAdd (startDate : Expression , days : Expression )
146
149
extends BinaryExpression with ImplicitCastInputTypes {
147
150
@@ -174,7 +177,8 @@ case class DateAdd(startDate: Expression, days: Expression)
174
177
Examples:
175
178
> SELECT _FUNC_('2016-07-30', 1);
176
179
2016-07-29
177
- """ )
180
+ """ ,
181
+ since = " 1.5.0" )
178
182
case class DateSub (startDate : Expression , days : Expression )
179
183
extends BinaryExpression with ImplicitCastInputTypes {
180
184
override def left : Expression = startDate
@@ -203,7 +207,8 @@ case class DateSub(startDate: Expression, days: Expression)
203
207
Examples:
204
208
> SELECT _FUNC_('2009-07-30 12:58:59');
205
209
12
206
- """ )
210
+ """ ,
211
+ since = " 1.5.0" )
207
212
case class Hour (child : Expression , timeZoneId : Option [String ] = None )
208
213
extends UnaryExpression with TimeZoneAwareExpression with ImplicitCastInputTypes {
209
214
@@ -233,7 +238,8 @@ case class Hour(child: Expression, timeZoneId: Option[String] = None)
233
238
Examples:
234
239
> SELECT _FUNC_('2009-07-30 12:58:59');
235
240
58
236
- """ )
241
+ """ ,
242
+ since = " 1.5.0" )
237
243
case class Minute (child : Expression , timeZoneId : Option [String ] = None )
238
244
extends UnaryExpression with TimeZoneAwareExpression with ImplicitCastInputTypes {
239
245
@@ -263,7 +269,8 @@ case class Minute(child: Expression, timeZoneId: Option[String] = None)
263
269
Examples:
264
270
> SELECT _FUNC_('2009-07-30 12:58:59');
265
271
59
266
- """ )
272
+ """ ,
273
+ since = " 1.5.0" )
267
274
case class Second (child : Expression , timeZoneId : Option [String ] = None )
268
275
extends UnaryExpression with TimeZoneAwareExpression with ImplicitCastInputTypes {
269
276
@@ -293,7 +300,8 @@ case class Second(child: Expression, timeZoneId: Option[String] = None)
293
300
Examples:
294
301
> SELECT _FUNC_('2016-04-09');
295
302
100
296
- """ )
303
+ """ ,
304
+ since = " 1.5.0" )
297
305
case class DayOfYear (child : Expression ) extends UnaryExpression with ImplicitCastInputTypes {
298
306
299
307
override def inputTypes : Seq [AbstractDataType ] = Seq (DateType )
@@ -316,7 +324,8 @@ case class DayOfYear(child: Expression) extends UnaryExpression with ImplicitCas
316
324
Examples:
317
325
> SELECT _FUNC_('2016-07-30');
318
326
2016
319
- """ )
327
+ """ ,
328
+ since = " 1.5.0" )
320
329
case class Year (child : Expression ) extends UnaryExpression with ImplicitCastInputTypes {
321
330
322
331
override def inputTypes : Seq [AbstractDataType ] = Seq (DateType )
@@ -339,7 +348,8 @@ case class Year(child: Expression) extends UnaryExpression with ImplicitCastInpu
339
348
Examples:
340
349
> SELECT _FUNC_('2016-08-31');
341
350
3
342
- """ )
351
+ """ ,
352
+ since = " 1.5.0" )
343
353
case class Quarter (child : Expression ) extends UnaryExpression with ImplicitCastInputTypes {
344
354
345
355
override def inputTypes : Seq [AbstractDataType ] = Seq (DateType )
@@ -362,7 +372,8 @@ case class Quarter(child: Expression) extends UnaryExpression with ImplicitCastI
362
372
Examples:
363
373
> SELECT _FUNC_('2016-07-30');
364
374
7
365
- """ )
375
+ """ ,
376
+ since = " 1.5.0" )
366
377
case class Month (child : Expression ) extends UnaryExpression with ImplicitCastInputTypes {
367
378
368
379
override def inputTypes : Seq [AbstractDataType ] = Seq (DateType )
@@ -385,7 +396,8 @@ case class Month(child: Expression) extends UnaryExpression with ImplicitCastInp
385
396
Examples:
386
397
> SELECT _FUNC_('2009-07-30');
387
398
30
388
- """ )
399
+ """ ,
400
+ since = " 1.5.0" )
389
401
case class DayOfMonth (child : Expression ) extends UnaryExpression with ImplicitCastInputTypes {
390
402
391
403
override def inputTypes : Seq [AbstractDataType ] = Seq (DateType )
@@ -409,7 +421,8 @@ case class DayOfMonth(child: Expression) extends UnaryExpression with ImplicitCa
409
421
Examples:
410
422
> SELECT _FUNC_('2009-07-30');
411
423
5
412
- """ )
424
+ """ ,
425
+ since = " 2.3.0" )
413
426
// scalastyle:on line.size.limit
414
427
case class DayOfWeek (child : Expression ) extends UnaryExpression with ImplicitCastInputTypes {
415
428
@@ -447,7 +460,8 @@ case class DayOfWeek(child: Expression) extends UnaryExpression with ImplicitCas
447
460
Examples:
448
461
> SELECT _FUNC_('2008-02-20');
449
462
8
450
- """ )
463
+ """ ,
464
+ since = " 1.5.0" )
451
465
// scalastyle:on line.size.limit
452
466
case class WeekOfYear (child : Expression ) extends UnaryExpression with ImplicitCastInputTypes {
453
467
@@ -493,7 +507,8 @@ case class WeekOfYear(child: Expression) extends UnaryExpression with ImplicitCa
493
507
Examples:
494
508
> SELECT _FUNC_('2016-04-08', 'y');
495
509
2016
496
- """ )
510
+ """ ,
511
+ since = " 1.5.0" )
497
512
// scalastyle:on line.size.limit
498
513
case class DateFormatClass (left : Expression , right : Expression , timeZoneId : Option [String ] = None )
499
514
extends BinaryExpression with TimeZoneAwareExpression with ImplicitCastInputTypes {
@@ -534,7 +549,8 @@ case class DateFormatClass(left: Expression, right: Expression, timeZoneId: Opti
534
549
Examples:
535
550
> SELECT _FUNC_('2016-04-08', 'yyyy-MM-dd');
536
551
1460041200
537
- """ )
552
+ """ ,
553
+ since = " 1.6.0" )
538
554
case class ToUnixTimestamp (
539
555
timeExp : Expression ,
540
556
format : Expression ,
@@ -574,7 +590,8 @@ case class ToUnixTimestamp(
574
590
1476884637
575
591
> SELECT _FUNC_('2016-04-08', 'yyyy-MM-dd');
576
592
1460041200
577
- """ )
593
+ """ ,
594
+ since = " 1.5.0" )
578
595
case class UnixTimestamp (timeExp : Expression , format : Expression , timeZoneId : Option [String ] = None )
579
596
extends UnixTime {
580
597
@@ -724,7 +741,8 @@ abstract class UnixTime
724
741
Examples:
725
742
> SELECT _FUNC_(0, 'yyyy-MM-dd HH:mm:ss');
726
743
1970-01-01 00:00:00
727
- """ )
744
+ """ ,
745
+ since = " 1.5.0" )
728
746
case class FromUnixTime (sec : Expression , format : Expression , timeZoneId : Option [String ] = None )
729
747
extends BinaryExpression with TimeZoneAwareExpression with ImplicitCastInputTypes {
730
748
@@ -833,7 +851,8 @@ case class FromUnixTime(sec: Expression, format: Expression, timeZoneId: Option[
833
851
Examples:
834
852
> SELECT _FUNC_('2009-01-12');
835
853
2009-01-31
836
- """ )
854
+ """ ,
855
+ since = " 1.5.0" )
837
856
case class LastDay (startDate : Expression ) extends UnaryExpression with ImplicitCastInputTypes {
838
857
override def child : Expression = startDate
839
858
@@ -867,7 +886,8 @@ case class LastDay(startDate: Expression) extends UnaryExpression with ImplicitC
867
886
Examples:
868
887
> SELECT _FUNC_('2015-01-14', 'TU');
869
888
2015-01-20
870
- """ )
889
+ """ ,
890
+ since = " 1.5.0" )
871
891
// scalastyle:on line.size.limit
872
892
case class NextDay (startDate : Expression , dayOfWeek : Expression )
873
893
extends BinaryExpression with ImplicitCastInputTypes {
@@ -968,7 +988,8 @@ case class TimeAdd(start: Expression, interval: Expression, timeZoneId: Option[S
968
988
Examples:
969
989
> SELECT from_utc_timestamp('2016-08-31', 'Asia/Seoul');
970
990
2016-08-31 09:00:00
971
- """ )
991
+ """ ,
992
+ since = " 1.5.0" )
972
993
// scalastyle:on line.size.limit
973
994
case class FromUTCTimestamp (left : Expression , right : Expression )
974
995
extends BinaryExpression with ImplicitCastInputTypes {
@@ -1061,7 +1082,8 @@ case class TimeSub(start: Expression, interval: Expression, timeZoneId: Option[S
1061
1082
Examples:
1062
1083
> SELECT _FUNC_('2016-08-31', 1);
1063
1084
2016-09-30
1064
- """ )
1085
+ """ ,
1086
+ since = " 1.5.0" )
1065
1087
// scalastyle:on line.size.limit
1066
1088
case class AddMonths (startDate : Expression , numMonths : Expression )
1067
1089
extends BinaryExpression with ImplicitCastInputTypes {
@@ -1097,7 +1119,8 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
1097
1119
Examples:
1098
1120
> SELECT _FUNC_('1997-02-28 10:30:00', '1996-10-30');
1099
1121
3.94959677
1100
- """ )
1122
+ """ ,
1123
+ since = " 1.5.0" )
1101
1124
// scalastyle:on line.size.limit
1102
1125
case class MonthsBetween (date1 : Expression , date2 : Expression , timeZoneId : Option [String ] = None )
1103
1126
extends BinaryExpression with TimeZoneAwareExpression with ImplicitCastInputTypes {
@@ -1140,7 +1163,8 @@ case class MonthsBetween(date1: Expression, date2: Expression, timeZoneId: Optio
1140
1163
Examples:
1141
1164
> SELECT _FUNC_('2016-08-31', 'Asia/Seoul');
1142
1165
2016-08-30 15:00:00
1143
- """ )
1166
+ """ ,
1167
+ since = " 1.5.0" )
1144
1168
// scalastyle:on line.size.limit
1145
1169
case class ToUTCTimestamp (left : Expression , right : Expression )
1146
1170
extends BinaryExpression with ImplicitCastInputTypes {
@@ -1203,7 +1227,8 @@ case class ToUTCTimestamp(left: Expression, right: Expression)
1203
1227
2009-07-30
1204
1228
> SELECT _FUNC_('2016-12-31', 'yyyy-MM-dd');
1205
1229
2016-12-31
1206
- """ )
1230
+ """ ,
1231
+ since = " 1.5.0" )
1207
1232
case class ParseToDate (left : Expression , format : Option [Expression ], child : Expression )
1208
1233
extends RuntimeReplaceable {
1209
1234
@@ -1244,7 +1269,8 @@ case class ParseToDate(left: Expression, format: Option[Expression], child: Expr
1244
1269
2016-12-31 00:12:00
1245
1270
> SELECT _FUNC_('2016-12-31', 'yyyy-MM-dd');
1246
1271
2016-12-31 00:00:00
1247
- """ )
1272
+ """ ,
1273
+ since = " 2.2.0" )
1248
1274
case class ParseToTimestamp (left : Expression , format : Option [Expression ], child : Expression )
1249
1275
extends RuntimeReplaceable {
1250
1276
@@ -1279,7 +1305,8 @@ case class ParseToTimestamp(left: Expression, format: Option[Expression], child:
1279
1305
2009-02-01
1280
1306
> SELECT _FUNC_('2015-10-27', 'YEAR');
1281
1307
2015-01-01
1282
- """ )
1308
+ """ ,
1309
+ since = " 1.5.0" )
1283
1310
// scalastyle:on line.size.limit
1284
1311
case class TruncDate (date : Expression , format : Expression )
1285
1312
extends BinaryExpression with ImplicitCastInputTypes {
@@ -1359,7 +1386,8 @@ case class TruncDate(date: Expression, format: Expression)
1359
1386
1360
1387
> SELECT _FUNC_('2009-07-30', '2009-07-31');
1361
1388
-1
1362
- """ )
1389
+ """ ,
1390
+ since = " 1.5.0" )
1363
1391
case class DateDiff (endDate : Expression , startDate : Expression )
1364
1392
extends BinaryExpression with ImplicitCastInputTypes {
1365
1393
0 commit comments