Commit 533ef2d
[SPARK-45787][SQL] Support Catalog.listColumns for clustering columns
### What changes were proposed in this pull request?
Support listColumns API for clustering columns.
### Why are the changes needed?
Clustering columns should be supported, just like partition and bucket columns, for listColumns API.
### Does this PR introduce _any_ user-facing change?
Yes, listColumns will now show an additional field `isCluster` to indicate whether the column is a clustering column.
Old output for `spark.catalog.listColumns`:
```
+----+-----------+--------+--------+-----------+--------+
|name|description|dataType|nullable|isPartition|isBucket|
+----+-----------+--------+--------+-----------+--------+
| a| null| int| true| false| false|
| b| null| string| true| false| false|
| c| null| int| true| false| false|
| d| null| string| true| false| false|
+----+-----------+--------+--------+-----------+--------+
```
New output:
```
+----+-----------+--------+--------+-----------+--------+---------+
|name|description|dataType|nullable|isPartition|isBucket|isCluster|
+----+-----------+--------+--------+-----------+--------+---------+
| a| null| int| true| false| false| false|
| b| null| string| true| false| false| false|
| c| null| int| true| false| false| false|
| d| null| string| true| false| false| false|
+----+-----------+--------+--------+-----------+--------+---------+
```
### How was this patch tested?
New unit tests.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes apache#47451 from zedtang/list-clustering-columns.
Authored-by: Jiaheng Tang <jiaheng.tang@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>1 parent 59f0c4a commit 533ef2d
File tree
10 files changed
+87
-28
lines changed- R/pkg/tests/fulltests
- connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/catalog
- python/pyspark/sql
- connect
- tests
- sql
- catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog
- core/src
- main/scala/org/apache/spark/sql
- catalog
- internal
- test/scala/org/apache/spark/sql/internal
10 files changed
+87
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4152 | 4152 | | |
4153 | 4153 | | |
4154 | 4154 | | |
4155 | | - | |
| 4155 | + | |
| 4156 | + | |
4156 | 4157 | | |
4157 | 4158 | | |
4158 | 4159 | | |
| |||
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
164 | | - | |
| 166 | + | |
| 167 | + | |
165 | 168 | | |
166 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
167 | 180 | | |
168 | 181 | | |
169 | 182 | | |
170 | 183 | | |
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
174 | | - | |
| 187 | + | |
| 188 | + | |
175 | 189 | | |
176 | 190 | | |
177 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
663 | 664 | | |
664 | 665 | | |
665 | 666 | | |
| 667 | + | |
666 | 668 | | |
667 | 669 | | |
668 | 670 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
370 | 371 | | |
371 | 372 | | |
372 | 373 | | |
| |||
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
| 382 | + | |
381 | 383 | | |
382 | 384 | | |
383 | 385 | | |
| |||
393 | 395 | | |
394 | 396 | | |
395 | 397 | | |
| 398 | + | |
396 | 399 | | |
397 | 400 | | |
398 | 401 | | |
| |||
404 | 407 | | |
405 | 408 | | |
406 | 409 | | |
| 410 | + | |
407 | 411 | | |
408 | 412 | | |
409 | 413 | | |
| |||
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
233 | 236 | | |
234 | 237 | | |
235 | 238 | | |
| |||
1111 | 1114 | | |
1112 | 1115 | | |
1113 | 1116 | | |
1114 | | - | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1115 | 1120 | | |
1116 | 1121 | | |
1117 | 1122 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
532 | | - | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
533 | 536 | | |
534 | 537 | | |
535 | 538 | | |
| |||
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| |||
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
147 | | - | |
| 148 | + | |
| 149 | + | |
148 | 150 | | |
149 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
150 | 162 | | |
151 | 163 | | |
152 | 164 | | |
153 | 165 | | |
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
157 | | - | |
| 169 | + | |
| 170 | + | |
158 | 171 | | |
159 | 172 | | |
160 | 173 | | |
| |||
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
398 | | - | |
| 397 | + | |
399 | 398 | | |
400 | 399 | | |
401 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
402 | 405 | | |
403 | 406 | | |
404 | 407 | | |
| |||
415 | 418 | | |
416 | 419 | | |
417 | 420 | | |
418 | | - | |
| 421 | + | |
| 422 | + | |
419 | 423 | | |
420 | 424 | | |
421 | 425 | | |
422 | 426 | | |
423 | 427 | | |
424 | 428 | | |
425 | 429 | | |
426 | | - | |
| 430 | + | |
| 431 | + | |
427 | 432 | | |
428 | 433 | | |
429 | 434 | | |
| |||
Lines changed: 26 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
113 | 117 | | |
114 | 118 | | |
115 | 119 | | |
| 120 | + | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
| |||
406 | 411 | | |
407 | 412 | | |
408 | 413 | | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
413 | 418 | | |
414 | 419 | | |
415 | 420 | | |
416 | 421 | | |
417 | 422 | | |
418 | 423 | | |
419 | 424 | | |
420 | | - | |
| 425 | + | |
| 426 | + | |
421 | 427 | | |
422 | 428 | | |
423 | 429 | | |
424 | | - | |
| 430 | + | |
| 431 | + | |
425 | 432 | | |
426 | 433 | | |
427 | 434 | | |
428 | | - | |
| 435 | + | |
| 436 | + | |
429 | 437 | | |
430 | 438 | | |
431 | 439 | | |
432 | 440 | | |
433 | 441 | | |
434 | 442 | | |
435 | | - | |
| 443 | + | |
| 444 | + | |
436 | 445 | | |
437 | 446 | | |
438 | 447 | | |
439 | | - | |
| 448 | + | |
| 449 | + | |
440 | 450 | | |
441 | 451 | | |
442 | 452 | | |
| |||
476 | 486 | | |
477 | 487 | | |
478 | 488 | | |
479 | | - | |
| 489 | + | |
480 | 490 | | |
481 | | - | |
| 491 | + | |
482 | 492 | | |
483 | | - | |
| 493 | + | |
484 | 494 | | |
485 | | - | |
| 495 | + | |
486 | 496 | | |
487 | 497 | | |
488 | 498 | | |
| |||
491 | 501 | | |
492 | 502 | | |
493 | 503 | | |
494 | | - | |
| 504 | + | |
| 505 | + | |
495 | 506 | | |
496 | 507 | | |
497 | 508 | | |
| |||
503 | 514 | | |
504 | 515 | | |
505 | 516 | | |
506 | | - | |
| 517 | + | |
507 | 518 | | |
508 | 519 | | |
509 | 520 | | |
| |||
0 commit comments