Skip to content

Commit 31e1ea1

Browse files
MaxGekkdongjoon-hyun
authored andcommitted
[SPARK-32130][SQL][FOLLOWUP] Enable timestamps inference in JsonBenchmark
### What changes were proposed in this pull request? Set the JSON option `inferTimestamp` to `true` for the cases that measure perf of timestamp inference. ### Why are the changes needed? The PR #28966 disabled timestamp inference by default. As a consequence, some benchmarks don't measure perf of timestamp inference from JSON fields. This PR explicitly enable such inference. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? By re-generating results of `JsonBenchmark`. Closes #28981 from MaxGekk/json-inferTimestamps-disable-by-default-followup. Authored-by: Max Gekk <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 42f01e3) Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 334b1e8 commit 31e1ea1

File tree

3 files changed

+88
-88
lines changed

3 files changed

+88
-88
lines changed

sql/core/benchmarks/JsonBenchmark-jdk11-results.txt

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,106 +7,106 @@ OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu218.04 on Linux 4.15.0-106
77
Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
88
JSON schema inferring: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
99
------------------------------------------------------------------------------------------------------------------------
10-
No encoding 69219 69342 116 1.4 692.2 1.0X
11-
UTF-8 is set 143950 143986 55 0.7 1439.5 0.5X
10+
No encoding 73307 73400 141 1.4 733.1 1.0X
11+
UTF-8 is set 143834 143925 152 0.7 1438.3 0.5X
1212

1313
Preparing data for benchmarking ...
1414
OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu218.04 on Linux 4.15.0-1063-aws
1515
Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
1616
count a short column: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
1717
------------------------------------------------------------------------------------------------------------------------
18-
No encoding 57828 57913 136 1.7 578.3 1.0X
19-
UTF-8 is set 83649 83711 60 1.2 836.5 0.7X
18+
No encoding 50894 51065 292 2.0 508.9 1.0X
19+
UTF-8 is set 98462 99455 1173 1.0 984.6 0.5X
2020

2121
Preparing data for benchmarking ...
2222
OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu218.04 on Linux 4.15.0-1063-aws
2323
Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
2424
count a wide column: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
2525
------------------------------------------------------------------------------------------------------------------------
26-
No encoding 64560 65193 1023 0.2 6456.0 1.0X
27-
UTF-8 is set 102925 103174 216 0.1 10292.5 0.6X
26+
No encoding 64011 64969 1001 0.2 6401.1 1.0X
27+
UTF-8 is set 102757 102984 311 0.1 10275.7 0.6X
2828

2929
Preparing data for benchmarking ...
3030
OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu218.04 on Linux 4.15.0-1063-aws
3131
Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
3232
select wide row: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
3333
------------------------------------------------------------------------------------------------------------------------
34-
No encoding 131002 132316 1160 0.0 262003.1 1.0X
35-
UTF-8 is set 152128 152371 332 0.0 304256.5 0.9X
34+
No encoding 132559 133561 1010 0.0 265117.3 1.0X
35+
UTF-8 is set 151458 152129 611 0.0 302915.4 0.9X
3636

3737
Preparing data for benchmarking ...
3838
OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu218.04 on Linux 4.15.0-1063-aws
3939
Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
4040
Select a subset of 10 columns: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
4141
------------------------------------------------------------------------------------------------------------------------
42-
Select 10 columns 19376 19514 160 0.5 1937.6 1.0X
43-
Select 1 column 24089 24156 58 0.4 2408.9 0.8X
42+
Select 10 columns 21148 21202 87 0.5 2114.8 1.0X
43+
Select 1 column 24701 24724 21 0.4 2470.1 0.9X
4444

4545
Preparing data for benchmarking ...
4646
OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu218.04 on Linux 4.15.0-1063-aws
4747
Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
4848
creation of JSON parser per line: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
4949
------------------------------------------------------------------------------------------------------------------------
50-
Short column without encoding 8131 8219 103 1.2 813.1 1.0X
51-
Short column with UTF-8 13464 13508 44 0.7 1346.4 0.6X
52-
Wide column without encoding 108012 108598 914 0.1 10801.2 0.1X
53-
Wide column with UTF-8 150988 151369 412 0.1 15098.8 0.1X
50+
Short column without encoding 6945 6998 59 1.4 694.5 1.0X
51+
Short column with UTF-8 11510 11569 51 0.9 1151.0 0.6X
52+
Wide column without encoding 95004 95795 790 0.1 9500.4 0.1X
53+
Wide column with UTF-8 149223 149409 276 0.1 14922.3 0.0X
5454

5555
Preparing data for benchmarking ...
5656
OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu218.04 on Linux 4.15.0-1063-aws
5757
Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
5858
JSON functions: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
5959
------------------------------------------------------------------------------------------------------------------------
60-
Text read 753 765 18 13.3 75.3 1.0X
61-
from_json 23182 23446 230 0.4 2318.2 0.0X
62-
json_tuple 31129 31304 181 0.3 3112.9 0.0X
63-
get_json_object 22821 23073 225 0.4 2282.1 0.0X
60+
Text read 649 652 3 15.4 64.9 1.0X
61+
from_json 22284 22393 99 0.4 2228.4 0.0X
62+
json_tuple 32310 32824 484 0.3 3231.0 0.0X
63+
get_json_object 22111 22751 568 0.5 2211.1 0.0X
6464

6565
Preparing data for benchmarking ...
6666
OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu218.04 on Linux 4.15.0-1063-aws
6767
Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
6868
Dataset of json strings: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
6969
------------------------------------------------------------------------------------------------------------------------
70-
Text read 3078 3101 26 16.2 61.6 1.0X
71-
schema inferring 30225 30434 333 1.7 604.5 0.1X
72-
parsing 32237 32308 63 1.6 644.7 0.1X
70+
Text read 2894 2903 8 17.3 57.9 1.0X
71+
schema inferring 26724 26785 62 1.9 534.5 0.1X
72+
parsing 37502 37632 131 1.3 750.0 0.1X
7373

7474
Preparing data for benchmarking ...
7575
OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu218.04 on Linux 4.15.0-1063-aws
7676
Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
7777
Json files in the per-line mode: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
7878
------------------------------------------------------------------------------------------------------------------------
79-
Text read 10835 10900 86 4.6 216.7 1.0X
80-
Schema inferring 37720 37805 110 1.3 754.4 0.3X
81-
Parsing without charset 35464 35538 100 1.4 709.3 0.3X
82-
Parsing with UTF-8 67311 67738 381 0.7 1346.2 0.2X
79+
Text read 10994 11010 16 4.5 219.9 1.0X
80+
Schema inferring 45654 45677 37 1.1 913.1 0.2X
81+
Parsing without charset 34476 34559 73 1.5 689.5 0.3X
82+
Parsing with UTF-8 56987 57002 13 0.9 1139.7 0.2X
8383

8484
OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu218.04 on Linux 4.15.0-1063-aws
8585
Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
8686
Write dates and timestamps: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
8787
------------------------------------------------------------------------------------------------------------------------
88-
Create a dataset of timestamps 2208 2222 14 4.5 220.8 1.0X
89-
to_json(timestamp) 14299 14570 285 0.7 1429.9 0.2X
90-
write timestamps to files 12955 12969 13 0.8 1295.5 0.2X
91-
Create a dataset of dates 2297 2323 30 4.4 229.7 1.0X
92-
to_json(date) 8509 8561 74 1.2 850.9 0.3X
93-
write dates to files 6786 6827 45 1.5 678.6 0.3X
88+
Create a dataset of timestamps 2150 2188 35 4.7 215.0 1.0X
89+
to_json(timestamp) 17874 18080 294 0.6 1787.4 0.1X
90+
write timestamps to files 12518 12538 34 0.8 1251.8 0.2X
91+
Create a dataset of dates 2298 2310 18 4.4 229.8 0.9X
92+
to_json(date) 11673 11703 27 0.9 1167.3 0.2X
93+
write dates to files 7121 7135 12 1.4 712.1 0.3X
9494

9595
OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu218.04 on Linux 4.15.0-1063-aws
9696
Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
9797
Read dates and timestamps: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
9898
------------------------------------------------------------------------------------------------------------------------
99-
read timestamp text from files 2598 2613 18 3.8 259.8 1.0X
100-
read timestamps from files 42007 42028 19 0.2 4200.7 0.1X
101-
infer timestamps from files 18102 18120 28 0.6 1810.2 0.1X
102-
read date text from files 2355 2360 5 4.2 235.5 1.1X
103-
read date from files 17420 17458 33 0.6 1742.0 0.1X
104-
timestamp strings 3099 3101 3 3.2 309.9 0.8X
105-
parse timestamps from Dataset[String] 48188 48215 25 0.2 4818.8 0.1X
106-
infer timestamps from Dataset[String] 22929 22988 102 0.4 2292.9 0.1X
107-
date strings 4090 4103 11 2.4 409.0 0.6X
108-
parse dates from Dataset[String] 24952 25068 139 0.4 2495.2 0.1X
109-
from_json(timestamp) 66038 66352 413 0.2 6603.8 0.0X
110-
from_json(date) 43755 43782 27 0.2 4375.5 0.1X
99+
read timestamp text from files 2616 2641 34 3.8 261.6 1.0X
100+
read timestamps from files 37481 37517 58 0.3 3748.1 0.1X
101+
infer timestamps from files 84774 84964 201 0.1 8477.4 0.0X
102+
read date text from files 2362 2365 3 4.2 236.2 1.1X
103+
read date from files 16583 16612 29 0.6 1658.3 0.2X
104+
timestamp strings 3927 3963 40 2.5 392.7 0.7X
105+
parse timestamps from Dataset[String] 52827 53004 243 0.2 5282.7 0.0X
106+
infer timestamps from Dataset[String] 101108 101644 769 0.1 10110.8 0.0X
107+
date strings 4886 4906 26 2.0 488.6 0.5X
108+
parse dates from Dataset[String] 27623 27694 62 0.4 2762.3 0.1X
109+
from_json(timestamp) 71764 71887 124 0.1 7176.4 0.0X
110+
from_json(date) 46200 46314 99 0.2 4620.0 0.1X
111111

112112

0 commit comments

Comments
 (0)