Commit fe2fb7f
[SPARK-9620] [SQL] generated UnsafeProjection should support many columns or large exressions
Currently, generated UnsafeProjection can reach 64k byte code limit of Java. This patch will split the generated expressions into multiple functions, to avoid the limitation.
After this patch, we can work well with table that have up to 64k columns (hit max number of constants limit in Java), it should be enough in practice.
cc rxin
Author: Davies Liu <[email protected]>
Closes apache#8044 from davies/wider_table and squashes the following commits:
9192e6c [Davies Liu] fix generated safe projection
d1ef81a [Davies Liu] fix failed tests
737b3d3 [Davies Liu] Merge branch 'master' of github.com:apache/spark into wider_table
ffcd132 [Davies Liu] address comments
1b95be4 [Davies Liu] put the generated class into sql package
77ed72d [Davies Liu] address comments
4518e17 [Davies Liu] Merge branch 'master' of github.com:apache/spark into wider_table
75ccd01 [Davies Liu] Merge branch 'master' of github.com:apache/spark into wider_table
495e932 [Davies Liu] support wider table with more than 1k columns for generated projections1 parent 40ed2af commit fe2fb7f
File tree
6 files changed
+207
-142
lines changed- sql/catalyst/src
- main/scala/org/apache/spark/sql/catalyst/expressions/codegen
- test/scala/org/apache/spark/sql/catalyst/expressions/codegen
6 files changed
+207
-142
lines changedLines changed: 45 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
265 | 266 | | |
266 | 267 | | |
267 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
268 | 308 | | |
269 | 309 | | |
270 | 310 | | |
| |||
289 | 329 | | |
290 | 330 | | |
291 | 331 | | |
292 | | - | |
| 332 | + | |
293 | 333 | | |
294 | 334 | | |
295 | 335 | | |
296 | | - | |
| 336 | + | |
297 | 337 | | |
298 | 338 | | |
299 | 339 | | |
300 | | - | |
| 340 | + | |
301 | 341 | | |
302 | 342 | | |
303 | 343 | | |
| |||
328 | 368 | | |
329 | 369 | | |
330 | 370 | | |
| 371 | + | |
| 372 | + | |
331 | 373 | | |
332 | 374 | | |
333 | 375 | | |
| |||
Lines changed: 6 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 68 | + | |
97 | 69 | | |
98 | 70 | | |
99 | 71 | | |
100 | | - | |
| 72 | + | |
101 | 73 | | |
102 | 74 | | |
103 | | - | |
| 75 | + | |
104 | 76 | | |
105 | 77 | | |
106 | 78 | | |
107 | 79 | | |
108 | 80 | | |
109 | 81 | | |
110 | | - | |
| 82 | + | |
111 | 83 | | |
112 | 84 | | |
113 | 85 | | |
| |||
123 | 95 | | |
124 | 96 | | |
125 | 97 | | |
126 | | - | |
127 | | - | |
128 | 98 | | |
129 | 99 | | |
130 | | - | |
131 | | - | |
| 100 | + | |
132 | 101 | | |
133 | 102 | | |
134 | 103 | | |
| |||
Lines changed: 11 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
| |||
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
57 | | - | |
| 57 | + | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
61 | | - | |
| 61 | + | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
131 | | - | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 147 | + | |
176 | 148 | | |
177 | 149 | | |
178 | 150 | | |
| |||
183 | 155 | | |
184 | 156 | | |
185 | 157 | | |
| 158 | + | |
186 | 159 | | |
187 | 160 | | |
188 | 161 | | |
189 | 162 | | |
190 | 163 | | |
191 | 164 | | |
192 | 165 | | |
193 | | - | |
194 | | - | |
195 | 166 | | |
196 | 167 | | |
197 | | - | |
198 | | - | |
| 168 | + | |
199 | 169 | | |
200 | 170 | | |
201 | 171 | | |
| |||
0 commit comments