Commit a47d978
feat(contrib): SPI surface additions for contribs that need core helpers
Format-agnostic surface additions PR2's Delta port (and any future
file-format contrib) needs without duplicating ~600 lines of
CometScanRule's existing schema-check / encryption-gate / marker-dispatch
helpers. No specific format is named anywhere in core; contribs register
their own tags through the SPI.
1. CometScanRule.isSchemaSupported widened from private to private[comet]
so contrib extensions under org.apache.comet.contrib.* can reuse the
same schema-check + fallback-reason emission rather than duplicating
the 25-line body. Zero behaviour change for in-tree callers.
2. CometOperatorSerdeExtension.matchOperator new default-Some-or-None
method for predicate-based serde dispatch. The class-keyed `serdes`
map can't disambiguate a marker pattern like
`CometScanExec(scanImpl="<contrib-specific-tag>")` (the class is
shared with core's generic CometScanExec). Contribs using such
markers override matchOperator. Backwards compatible: existing
contribs that only populate `serdes` see no change. `serdes` now
defaults to Map.empty so contribs that ONLY use matchOperator don't
need to override both.
3. CometExecRule three-step dispatch: allExecs (core class map) ->
mergedSerdes (contrib class map) -> matchOperator iteration (contrib
predicate). First Some wins; multiple extensions' matchOperator
results are tried in registration order.
4. CometOperatorSerdeExtension.nativeParquetScanImpls new
default-Set.empty method. Contribs that use the CometScanExec marker
pattern AND go through Comet's tuned ParquetSource declare their
scanImpl tag(s) here. CometScanExec.supportedDataFilters consults the
merged set (via CometExtensionRegistry.nativeParquetScanImpls) to
decide whether to apply native-parquet filter exclusions. Core no
longer needs to hard-code any contrib's tag name.
5. CometExtensionRegistry.nativeParquetScanImpls publishes the merged
tag set at load() time. Populated/reset alongside mergedSerdesCache
under the same monitor.
Contributor guide updated with the matchOperator + nativeParquetScanImpls
patterns and explicit guidance that contribs define their own scanImpl
strings in their own code -- core's CometConf only carries
SCAN_NATIVE_DATAFUSION / SCAN_NATIVE_ICEBERG_COMPAT for core's own
variants.
Verified
- cargo check (default features): green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 29f685c commit a47d978
6 files changed
Lines changed: 125 additions & 8 deletions
File tree
- docs/source/contributor-guide
- spark/src/main/scala/org/apache
- comet
- rules
- spi
- spark/sql/comet
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
281 | | - | |
282 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
| |||
296 | 297 | | |
297 | 298 | | |
298 | 299 | | |
299 | | - | |
300 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
301 | 336 | | |
302 | 337 | | |
303 | 338 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
360 | 366 | | |
361 | 367 | | |
362 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
363 | 374 | | |
364 | 375 | | |
365 | 376 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
780 | 780 | | |
781 | 781 | | |
782 | 782 | | |
783 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
784 | 786 | | |
785 | 787 | | |
786 | 788 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
117 | 129 | | |
118 | 130 | | |
119 | 131 | | |
| |||
162 | 174 | | |
163 | 175 | | |
164 | 176 | | |
| 177 | + | |
165 | 178 | | |
166 | 179 | | |
167 | 180 | | |
| |||
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 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 | + | |
53 | 92 | | |
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
163 | 169 | | |
164 | 170 | | |
165 | 171 | | |
| |||
534 | 540 | | |
535 | 541 | | |
536 | 542 | | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
537 | 554 | | |
538 | 555 | | |
539 | 556 | | |
| |||
0 commit comments