spark-instrumented-optimizer/sql/core/benchmarks/DateTimeBenchmark-results.txt
Kent Yao 0946a9514f [SPARK-31150][SQL] Parsing seconds fraction with variable length for timestamp
### What changes were proposed in this pull request?
This PR is to support parsing timestamp values with variable length second fraction parts.

e.g. 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]' can parse timestamp with 0~6 digit-length second fraction but fail >=7
```sql
select to_timestamp(v, 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') from values
 ('2019-10-06 10:11:12.'),
 ('2019-10-06 10:11:12.0'),
 ('2019-10-06 10:11:12.1'),
 ('2019-10-06 10:11:12.12'),
 ('2019-10-06 10:11:12.123UTC'),
 ('2019-10-06 10:11:12.1234'),
 ('2019-10-06 10:11:12.12345CST'),
 ('2019-10-06 10:11:12.123456PST') t(v)
2019-10-06 03:11:12.123
2019-10-06 08:11:12.12345
2019-10-06 10:11:12
2019-10-06 10:11:12
2019-10-06 10:11:12.1
2019-10-06 10:11:12.12
2019-10-06 10:11:12.1234
2019-10-06 10:11:12.123456

select to_timestamp('2019-10-06 10:11:12.1234567PST', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]')
NULL
```
Since 3.0, we use java 8 time API to parse and format timestamp values. when we create the `DateTimeFormatter`, we use `appendPattern` to create the build first, where the 'S..S' part will be parsed to a fixed-length(= `'S..S'.length`). This fits the formatting part but too strict for the parsing part because the trailing zeros are very likely to be truncated.

### Why are the changes needed?

improve timestamp parsing and more compatible with 2.4.x

### Does this PR introduce any user-facing change?

no, the related changes are newly added
### How was this patch tested?

add uts

Closes #27906 from yaooqinn/SPARK-31150.

Authored-by: Kent Yao <yaooqinn@hotmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
2020-03-17 21:53:46 +08:00

430 lines
34 KiB
Plaintext

================================================================================================
Extract components
================================================================================================
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
cast to timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
cast to timestamp wholestage off 243 256 18 41.2 24.3 1.0X
cast to timestamp wholestage on 193 206 19 51.9 19.3 1.3X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
year of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
year of timestamp wholestage off 784 786 3 12.8 78.4 1.0X
year of timestamp wholestage on 738 758 15 13.5 73.8 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
quarter of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
quarter of timestamp wholestage off 823 825 3 12.2 82.3 1.0X
quarter of timestamp wholestage on 791 804 12 12.6 79.1 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
month of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
month of timestamp wholestage off 681 692 16 14.7 68.1 1.0X
month of timestamp wholestage on 683 703 14 14.6 68.3 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
weekofyear of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
weekofyear of timestamp wholestage off 1015 1032 23 9.8 101.5 1.0X
weekofyear of timestamp wholestage on 1016 1106 72 9.8 101.6 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
day of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
day of timestamp wholestage off 683 689 9 14.6 68.3 1.0X
day of timestamp wholestage on 685 702 11 14.6 68.5 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
dayofyear of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
dayofyear of timestamp wholestage off 713 716 4 14.0 71.3 1.0X
dayofyear of timestamp wholestage on 704 713 9 14.2 70.4 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
dayofmonth of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
dayofmonth of timestamp wholestage off 738 746 11 13.5 73.8 1.0X
dayofmonth of timestamp wholestage on 684 704 16 14.6 68.4 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
dayofweek of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
dayofweek of timestamp wholestage off 810 821 15 12.3 81.0 1.0X
dayofweek of timestamp wholestage on 784 789 5 12.8 78.4 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
weekday of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
weekday of timestamp wholestage off 767 777 13 13.0 76.7 1.0X
weekday of timestamp wholestage on 765 777 11 13.1 76.5 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
hour of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
hour of timestamp wholestage off 534 543 13 18.7 53.4 1.0X
hour of timestamp wholestage on 499 529 22 20.0 49.9 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
minute of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
minute of timestamp wholestage off 526 544 26 19.0 52.6 1.0X
minute of timestamp wholestage on 495 515 20 20.2 49.5 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
second of timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
second of timestamp wholestage off 537 538 2 18.6 53.7 1.0X
second of timestamp wholestage on 508 512 5 19.7 50.8 1.1X
================================================================================================
Current date and time
================================================================================================
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
current_date: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
current_date wholestage off 164 169 6 60.8 16.4 1.0X
current_date wholestage on 165 171 4 60.4 16.5 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
current_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
current_timestamp wholestage off 161 168 10 62.0 16.1 1.0X
current_timestamp wholestage on 161 165 5 62.1 16.1 1.0X
================================================================================================
Date arithmetic
================================================================================================
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
cast to date: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
cast to date wholestage off 691 692 2 14.5 69.1 1.0X
cast to date wholestage on 572 586 16 17.5 57.2 1.2X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
last_day: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
last_day wholestage off 713 723 14 14.0 71.3 1.0X
last_day wholestage on 695 747 41 14.4 69.5 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
next_day: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
next_day wholestage off 627 630 4 15.9 62.7 1.0X
next_day wholestage on 615 660 39 16.3 61.5 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_add: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_add wholestage off 604 649 63 16.5 60.4 1.0X
date_add wholestage on 590 598 8 17.0 59.0 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_sub: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_sub wholestage off 588 592 5 17.0 58.8 1.0X
date_sub wholestage on 597 620 39 16.7 59.7 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
add_months: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
add_months wholestage off 777 782 8 12.9 77.7 1.0X
add_months wholestage on 769 786 22 13.0 76.9 1.0X
================================================================================================
Formatting dates
================================================================================================
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
format date: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
format date wholestage off 3335 3498 231 3.0 333.5 1.0X
format date wholestage on 3386 3488 103 3.0 338.6 1.0X
================================================================================================
Formatting timestamps
================================================================================================
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
from_unixtime: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
from_unixtime wholestage off 5291 5601 438 1.9 529.1 1.0X
from_unixtime wholestage on 5684 5952 256 1.8 568.4 0.9X
================================================================================================
Convert timestamps
================================================================================================
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
from_utc_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
from_utc_timestamp wholestage off 963 981 25 10.4 96.3 1.0X
from_utc_timestamp wholestage on 731 794 40 13.7 73.1 1.3X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
to_utc_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
to_utc_timestamp wholestage off 1129 1135 7 8.9 112.9 1.0X
to_utc_timestamp wholestage on 921 973 68 10.9 92.1 1.2X
================================================================================================
Intervals
================================================================================================
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
cast interval: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
cast interval wholestage off 197 197 0 50.8 19.7 1.0X
cast interval wholestage on 172 179 8 58.3 17.2 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
datediff: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
datediff wholestage off 1039 1105 93 9.6 103.9 1.0X
datediff wholestage on 1129 1162 22 8.9 112.9 0.9X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
months_between: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
months_between wholestage off 2624 2654 42 3.8 262.4 1.0X
months_between wholestage on 2612 2709 57 3.8 261.2 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
window: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
window wholestage off 1229 1247 25 0.8 1229.4 1.0X
window wholestage on 14409 15033 534 0.1 14409.2 0.1X
================================================================================================
Truncation
================================================================================================
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc YEAR: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc YEAR wholestage off 1203 1218 22 8.3 120.3 1.0X
date_trunc YEAR wholestage on 1162 1172 10 8.6 116.2 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc YYYY: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc YYYY wholestage off 1185 1199 20 8.4 118.5 1.0X
date_trunc YYYY wholestage on 1148 1173 22 8.7 114.8 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc YY: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc YY wholestage off 1189 1192 4 8.4 118.9 1.0X
date_trunc YY wholestage on 1168 1179 16 8.6 116.8 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc MON: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc MON wholestage off 1308 1317 14 7.6 130.8 1.0X
date_trunc MON wholestage on 1303 1352 37 7.7 130.3 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc MONTH: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc MONTH wholestage off 1301 1320 27 7.7 130.1 1.0X
date_trunc MONTH wholestage on 1171 1226 41 8.5 117.1 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc MM: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc MM wholestage off 1237 1259 31 8.1 123.7 1.0X
date_trunc MM wholestage on 1181 1195 11 8.5 118.1 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc DAY: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc DAY wholestage off 1364 1370 8 7.3 136.4 1.0X
date_trunc DAY wholestage on 1189 1223 31 8.4 118.9 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc DD: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc DD wholestage off 1297 1328 45 7.7 129.7 1.0X
date_trunc DD wholestage on 1171 1242 43 8.5 117.1 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc HOUR: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc HOUR wholestage off 1261 1317 79 7.9 126.1 1.0X
date_trunc HOUR wholestage on 1171 1225 48 8.5 117.1 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc MINUTE: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc MINUTE wholestage off 210 211 2 47.7 21.0 1.0X
date_trunc MINUTE wholestage on 178 200 18 56.2 17.8 1.2X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc SECOND: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc SECOND wholestage off 206 211 7 48.5 20.6 1.0X
date_trunc SECOND wholestage on 186 200 9 53.9 18.6 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc WEEK: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc WEEK wholestage off 1275 1307 46 7.8 127.5 1.0X
date_trunc WEEK wholestage on 1190 1244 63 8.4 119.0 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
date_trunc QUARTER: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
date_trunc QUARTER wholestage off 1688 1719 44 5.9 168.8 1.0X
date_trunc QUARTER wholestage on 1732 1795 45 5.8 173.2 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
trunc year: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
trunc year wholestage off 201 214 19 49.7 20.1 1.0X
trunc year wholestage on 150 157 11 66.5 15.0 1.3X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
trunc yyyy: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
trunc yyyy wholestage off 169 174 6 59.0 16.9 1.0X
trunc yyyy wholestage on 159 174 10 62.9 15.9 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
trunc yy: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
trunc yy wholestage off 171 179 12 58.5 17.1 1.0X
trunc yy wholestage on 170 180 9 58.8 17.0 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
trunc mon: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
trunc mon wholestage off 174 177 4 57.5 17.4 1.0X
trunc mon wholestage on 162 171 7 61.7 16.2 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
trunc month: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
trunc month wholestage off 195 196 2 51.2 19.5 1.0X
trunc month wholestage on 166 176 8 60.2 16.6 1.2X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
trunc mm: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
trunc mm wholestage off 156 160 6 64.2 15.6 1.0X
trunc mm wholestage on 147 162 13 68.1 14.7 1.1X
================================================================================================
Parsing
================================================================================================
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
to timestamp str: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
to timestamp str wholestage off 154 154 1 6.5 153.8 1.0X
to timestamp str wholestage on 127 132 6 7.9 126.5 1.2X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
to_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
to_timestamp wholestage off 973 1001 40 1.0 972.6 1.0X
to_timestamp wholestage on 912 922 12 1.1 912.3 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
to_unix_timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
to_unix_timestamp wholestage off 970 986 23 1.0 969.7 1.0X
to_unix_timestamp wholestage on 907 910 3 1.1 906.9 1.1X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
to date str: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
to date str wholestage off 154 155 1 6.5 154.3 1.0X
to date str wholestage on 156 165 6 6.4 155.9 1.0X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
to_date: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
to_date wholestage off 1757 1760 4 0.6 1756.6 1.0X
to_date wholestage on 1563 1626 41 0.6 1562.7 1.1X
================================================================================================
Conversion from/to external types
================================================================================================
Java HotSpot(TM) 64-Bit Server VM 1.8.0_231-b11 on Mac OS X 10.15.3
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
To/from java.sql.Timestamp: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
From java.sql.Timestamp 182 186 4 27.5 36.4 1.0X
Collect longs 1041 1652 964 4.8 208.2 0.2X
Collect timestamps 1003 1029 31 5.0 200.7 0.2X