[CORE] LocalFilesNode rebuilds the file schema for every file in a split

Open
#13,698 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.

  • #13699 by @LuciferYang — open

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
55/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
scala
Domain
performance

Research direction

Start from LocalFilesNode.toProtobuf and trace where the split-level schema is available before the per-file loop. Check the Velox ORC/DWRF scan path and the Parquet path controlled by spark.gluten.sql.columnar.backend.velox.parquetUseColumnNames, since the issue says they always set this schema. Done means the NamedStruct is built once per split, scans still receive the correct schema, and a wide ORC split no longer repeats the conversion per file.

Written by the indexing model from the issue text.

Description

LocalFilesNode.toProtobuf builds the file schema as a Substrait NamedStruct once for every file in the split, although all files in a split share the same schema. The Velox backend always sets this schema for ORC and DWRF scans, and for Parquet when spark.gluten.sql.columnar.backend.velox.parquetUseColumnNames is off, so every task of a small-file scan with a wide schema repeats the type conversion per file. For an ORC split of 128 files and 200 columns, toProtobuf takes about 16.7 ms.

The schema can be built once per split.

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

Dominant language
Scala
Stars
1.6k
Forks
679
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.