[CORE] ExpressionMappings rebuilds the expression map on every lookup

Open
#13,691 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

@LuciferYang is already working on this.

Since Nov 20, 2026.

  • #13692 by @LuciferYang — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
scala, spark
Domain
performance

Research direction

Start in the Scala object ExpressionMappings (in the Gluten core module), reading expressionsMap and blacklistExpressionMap to see where the ~360 default signatures are merged with the backend's extraExpressionMappings and partitioned by spark.gluten.expression.blacklist. Trace the callers in expression conversion, aggregate/window lookup and validation to confirm the inputs only change on config or backend registration. Done means the merged map is cached and correctly invalidated, with a TPC-H planning run showing the repeated rebuilds gone.

Written by the indexing model from the issue text.

Description

ExpressionMappings.expressionsMap and blacklistExpressionMap rebuild the whole mapping on every call: they merge the ~360 default signatures with the backend's extraExpressionMappings, then partition the result by spark.gluten.expression.blacklist. One call takes about 21 µs. Expression conversion, aggregate and window function lookups and validation call it repeatedly, about 98 times when planning a TPC-H query, although the inputs almost never change.

The result can be reused until the blacklist or the backend's extra mappings change.

This issue was written with the assistance of AI (Claude Opus).

Dominant language
Scala
Stars
1.6k
Forks
685
Avg merge
4d 16h
Merged PRs (30d)
84

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/gluten

All issues in apache/gluten

Similar issues

More Scala issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.