LuciferYang opened a new pull request, #12590: URL: https://github.com/apache/gluten/pull/12590
### What changes were proposed in this pull request? Cleanup pass over `gluten-core` that removes code paths no longer reachable or no longer referenced. Findings are the intersection of scalac `-Ywarn-unused:privates,locals,params,patvars` output on `gluten-core` and the `Dead code / dead cases` cross-cutting theme from the earlier L1/L2/L3 review docs. No behavior change on the reachable paths. 1. **`FloydWarshallGraph.Builder.Impl`**: drop the never-read `private var graph` field and its two `graph = None` writes in `addVertex` / `addEdge`. Remnant of an abandoned build-cache mechanism; the actual cache moved to `Transition.factory#graphCache`. 2. **`GlutenInjector.applier`**: drop the unread `val conf = new GlutenCoreConfig(session.sessionState.conf)` and the now-unused `import org.apache.gluten.config.GlutenCoreConfig`. `GlutenCoreConfig`'s constructor has no side effects at instantiation (only a lazy `configProvider` and plain getters). 3. **`ConfigHelpers.TIME_STRING_PATTERN`**: drop the compiled `Pattern` plus its `java.util.regex.Pattern` import. `timeFromString` delegates to `JavaUtils.timeStringAs`; the regex is never used. 4. **`canPropagateConvention`**: rename 5 unused pattern vars `p` to `_` in the `case _: X => true` arms. 5. **`Transition.Factory#findTransition`**: drop the unreachable `case _ => throw new UnsupportedOperationException(...)` on the outer `(RowType, BatchType)` match. `ConventionReq.RowType` and `ConventionReq.BatchType` are sealed with two subtypes each (`Any`, `Is(t)`); the four preceding cases already cover the full 2×2 product. The dead branch also had a buggy message that interpolated the `ConventionReq` companion object instead of the matched value. ### How was this patch tested? - `./build/mvn -Pbackends-velox -Pspark-3.5 -pl gluten-core -am install -DskipTests`: SUCCESS - `./build/mvn -Pbackends-velox -Pspark-3.5 -pl backends-velox -am test-compile -DskipTests`: SUCCESS - `./build/mvn -Pbackends-clickhouse -Pspark-3.3 -Pdelta -pl backends-clickhouse -am test-compile -DskipTests`: SUCCESS - `./dev/format-scala-code.sh`: no additional diff - Compilation runs under `-Wconf:any:e` (fatal warnings). Deleting the outer `case _` in `Transition.Factory#findTransition` does not introduce a non-exhaustive-match warning, confirming the four remaining cases fully cover the sealed 2×2 hierarchy. - Repo-wide `grep` verified: `TIME_STRING_PATTERN` (0 refs), `FloydWarshallGraph.Builder.Impl.graph` (0 read sites), `"Illegal convention requirement"` (0 test / caller references). ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude claude-opus-4-7 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
