Skip to content

importer, mydump: preload small parquet files in a single read (#68250) - #70193

Merged
ti-chi-bot[bot] merged 5 commits into
pingcap:release-nextgen-202603from
ti-chi-bot:cherry-pick-68250-to-release-nextgen-202603
Jul 30, 2026
Merged

ti-chi-bot[bot] merged 5 commits into
pingcap:release-nextgen-202603from
ti-chi-bot:cherry-pick-68250-to-release-nextgen-202603

Conversation

@ti-chi-bot

@ti-chi-bot ti-chi-bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #68250

What problem does this PR solve?

Issue Number: ref #66180

When IMPORT INTO ingests many small parquet files, each file's footer and row-group data are fetched in separate opens — two for footer parsing in NewParquetParser, then one per row group in getBuilder → newInMemoryReaderBase. With 1.5k × ~480 KiB parts, the redundant S3 round-trips dominate wall time.

What changed and how does it work?

Add a whole-file in-memory strategy alongside the existing per-row-group preload and per-column streaming, and unify their gating under one threshold inMemoryThreshold (128 MiB). NewParquetParser reads the file once via prepareReader when it fits, uses the buffer for footer parsing, and lets getBuilder serve every column from the same buffer. Larger files still fall through to per-row-group preload or streaming.

switch {
case pp.preloadBase != nil:
    return inMemoryColumnBuilder(pp.preloadBase, ranges, fileSize), nil
case ranges.end-ranges.start <= int64(inMemoryThreshold):
    base, _ := newInMemoryReaderBase(ctx, pp.store, pp.path, ranges)
    return inMemoryColumnBuilder(base, ranges, fileSize), nil
default:
    return streamingColumnBuilder(ctx, pp.store, pp.path, ranges), nil
}

Benchmark

Staging cluster, 1550 × ~480 KiB parquet files on AWS S3, prod-aligned schema. Baseline and PR back-to-back, 1 node × 1 thread.

Metric Baseline PR Delta
takeTime p50 ~232 ms ~231 ms flat
inter-chunk gap p50 ~1.2 s ~270 ms −77%
wall throughput 0.70 chunks/s 1.17 chunks/s +67%
encode step time 46:34 20:09 +131%

Gain lands in the inter-chunk gap (parser-open path); takeTime and deliver spikes are unaffected, as expected.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None.

Summary by CodeRabbit

  • Performance
    • Improved Parquet imports with adaptive whole-file preloading for smaller files and streaming/row-group reads for larger files, including whole-file preload reuse to reduce remote reads.
    • More efficient Parquet page handling to avoid large peak allocations on wide/large-page data.
  • Resource Management
    • Streamlined input reader lifecycle across Parquet, CSV, and SQL to reduce unnecessary open/close operations.
  • Reliability
    • More accurate Parquet memory estimation that accounts for file size, improving concurrency decisions for smoother imports.

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot ti-chi-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-nextgen-202603 labels Jul 29, 2026
@ti-chi-bot

Copy link
Copy Markdown
Member Author

@D3Hunter This PR has conflicts, I have hold it.
Please resolve them or ask others to resolve them, then comment /unhold to remove the hold label.

@ti-chi-bot

ti-chi-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 29, 2026
@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Parquet parsing now accepts deferred reader openers and file sizes, enabling whole-file, row-group, or streaming access. Importers and memory estimation pass the new metadata, while reader interfaces use io.ReadSeekCloser. Tests cover preload selection and remote access behavior.

Changes

Parquet reader refactor

Layer / File(s) Summary
Reader contracts and deferred opening
pkg/lightning/mydump/parser.go, pkg/lightning/mydump/reader.go, pkg/objstore/storeapi/storage.go, pkg/lightning/mydump/csv_parser.go, pkg/lightning/mydump/parquet_wrapper.go
Custom reader interfaces are replaced with io.ReadSeekCloser, and NewReaderOpener defers Parquet reader creation.
Parquet preload and parser construction
pkg/lightning/mydump/parquet_wrapper.go, pkg/lightning/mydump/parquet_parser.go
Parser construction selects whole-file, row-group, or streaming readers using file size and reuses whole-file preload buffers.
Importer and memory-estimation integration
lightning/pkg/importer/*, pkg/executor/importer/*, pkg/dxf/importinto/task_executor.go
Parquet import, sampling, and concurrency estimation pass reader openers, paths, and file sizes through the updated APIs.
Preload tests and parser migration validation
pkg/lightning/mydump/parquet_parser_test.go, pkg/lightning/mydump/BUILD.bazel
Tests cover deferred construction, preload modes, memory estimation, parser fixtures, and recorded remote access counts.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Importer
  participant NewParquetParser
  participant prepareReader
  participant ObjectStore
  Importer->>NewParquetParser: provide opener, path, and file size
  NewParquetParser->>prepareReader: choose preload strategy
  prepareReader->>ObjectStore: open or preload Parquet data
  prepareReader-->>NewParquetParser: return reader and preload base
  NewParquetParser-->>Importer: return configured parser
Loading

Possibly related PRs

  • pingcap/tidb#68250: Both changes implement the Parquet preload refactor and thread file size through parser construction.
  • pingcap/tidb#70075: Both changes modify Parquet reader initialization in NewParquetParser.

Suggested labels: component/import

Suggested reviewers: d3hunter, gmhdbjd

Poem

A rabbit hops through Parquet files,
With preload buffers stacked in piles.
“Open late, read smart,” I cheer,
Whole files or row groups draw near.
Fewer fetches make my ears go boing!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.15% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: faster Parquet import by preloading small files.
Description check ✅ Passed The description matches the template well, with issue number, problem summary, change details, tests, and release note.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lightning/pkg/importer/chunk_process.go`:
- Around line 111-117: Resolve the merge conflict in the parser initialization
by removing all conflict markers and retaining the parquetfile.NewParser call
with openReader and chunk.FileMeta.FileSize for preload support. Ensure the
parquetfile package is imported and the surrounding code remains valid Go.

In `@lightning/pkg/importer/get_pre_info.go`:
- Around line 494-502: Resolve the merge conflicts in both parser-construction
sites, removing all conflict markers and retaining the intended
parquetfile.NewParser integration. In the dataFileMeta path and the sampleFile
path, pass each SourceFileMeta’s actual FileSize instead of 0, while preserving
the appropriate reader and metadata arguments so small-file preloading remains
enabled.

In `@pkg/executor/importer/table_import.go`:
- Around line 346-352: Resolve the merge conflict in
TableImporter.EstimateParquetReaderMemory by removing the conflict markers and
retaining the parquetfile.EstimateParquetReaderMemory call with the fileSize
parameter. Update the method signature and delegation consistently so the code
compiles.

In `@pkg/lightning/mydump/parquet_parser_test.go`:
- Around line 39-48: Resolve every remaining merge conflict in the parquet
parser tests by retaining the incoming migration content from
pkg/dumpformat/parquetfile/parser_test.go and removing all conflict markers.
Ensure the file uses the updated imports, newParquetS3StoreForTest, the
FileMeta-aware newParquetParserForTest and NewParser call signatures,
EstimateParquetReaderMemory updates, and the added large-page and whole-file
memory tests.

In `@pkg/lightning/mydump/parquet_wrapper.go`:
- Around line 53-61: Resolve the cherry-pick conflict by removing all markers
and choosing one consistent wrapper/parser naming scheme. In
pkg/lightning/mydump/parquet_wrapper.go:53-61, reconcile
parquetWrapper/readerWrapper and update existing method receivers and
prepareReader accordingly; in pkg/lightning/mydump/parquet_parser.go:419-427,
625-652, 757-782, 801-812, and 959-965, use the same parser type and matching
constructor signature and initialization at getBuilder, constructor, sampling,
and memory-estimation call sites.
- Around line 38-41: Update the wholeFileInMemoryThreshold constant to 128 MiB
so files up to the intended limit use the whole-file preload path; leave the
surrounding memory-bound and object-store behavior unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f52832b3-2bae-4319-a779-6a516d66a8ef

📥 Commits

Reviewing files that changed from the base of the PR and between 8dffb79 and b98c3fc.

📒 Files selected for processing (13)
  • lightning/pkg/importer/chunk_process.go
  • lightning/pkg/importer/get_pre_info.go
  • pkg/dumpformat/parquetfile/BUILD.bazel
  • pkg/dxf/importinto/task_executor.go
  • pkg/executor/importer/import.go
  • pkg/executor/importer/table_import.go
  • pkg/lightning/mydump/csv_parser.go
  • pkg/lightning/mydump/parquet_parser.go
  • pkg/lightning/mydump/parquet_parser_test.go
  • pkg/lightning/mydump/parquet_wrapper.go
  • pkg/lightning/mydump/parser.go
  • pkg/lightning/mydump/reader.go
  • pkg/objstore/storeapi/storage.go
💤 Files with no reviewable changes (1)
  • pkg/objstore/storeapi/storage.go

Comment thread lightning/pkg/importer/chunk_process.go Outdated
Comment on lines +111 to +117
<<<<<<< HEAD
parser, err = mydump.NewParquetParser(ctx, store, reader, chunk.FileMeta.Path, chunk.FileMeta.ParquetMeta)
=======
parser, err = parquetfile.NewParser(
ctx, store, openReader, chunk.FileMeta.Path, chunk.FileMeta.FileSize, chunk.FileMeta.ParquetMeta,
)
>>>>>>> ab79433f43c (importer, mydump: preload small parquet files in a single read (#68250))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Unresolved git merge-conflict markers left in source.

Lines 111-117 contain literal <<<<<<< HEAD / ======= / >>>>>>> markers — this is invalid Go syntax and will fail to compile. Resolve by keeping the incoming (parquetfile.NewParser) branch that supports the new preload feature, and ensure the parquetfile package is imported.

🐛 Proposed resolution
-<<<<<<< HEAD
-		parser, err = mydump.NewParquetParser(ctx, store, reader, chunk.FileMeta.Path, chunk.FileMeta.ParquetMeta)
-=======
 		parser, err = parquetfile.NewParser(
 			ctx, store, openReader, chunk.FileMeta.Path, chunk.FileMeta.FileSize, chunk.FileMeta.ParquetMeta,
 		)
->>>>>>> ab79433f43c (importer, mydump: preload small parquet files in a single read (`#68250`))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<<<<<<< HEAD
parser, err = mydump.NewParquetParser(ctx, store, reader, chunk.FileMeta.Path, chunk.FileMeta.ParquetMeta)
=======
parser, err = parquetfile.NewParser(
ctx, store, openReader, chunk.FileMeta.Path, chunk.FileMeta.FileSize, chunk.FileMeta.ParquetMeta,
)
>>>>>>> ab79433f43c (importer, mydump: preload small parquet files in a single read (#68250))
parser, err = parquetfile.NewParser(
ctx, store, openReader, chunk.FileMeta.Path, chunk.FileMeta.FileSize, chunk.FileMeta.ParquetMeta,
)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lightning/pkg/importer/chunk_process.go` around lines 111 - 117, Resolve the
merge conflict in the parser initialization by removing all conflict markers and
retaining the parquetfile.NewParser call with openReader and
chunk.FileMeta.FileSize for preload support. Ensure the parquetfile package is
imported and the surrounding code remains valid Go.

Comment thread lightning/pkg/importer/get_pre_info.go Outdated
Comment on lines +494 to +502
<<<<<<< HEAD
parser, err = mydump.NewParquetParser(
ctx, p.srcStorage, reader,
dataFileMeta.Path, mydump.ParquetFileMeta{},
=======
parser, err = parquetfile.NewParser(
ctx, p.srcStorage, openReader,
dataFileMeta.Path, 0, parquetfile.FileMeta{},
>>>>>>> ab79433f43c (importer, mydump: preload small parquet files in a single read (#68250))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Unresolved merge-conflict markers, and dropped fileSize when resolving.

Both hunks still contain literal <<<<<<</=======/>>>>>>> markers (invalid Go syntax, will not compile). Additionally, the incoming side hardcodes fileSize=0 when calling parquetfile.NewParser, even though dataFileMeta.FileSize (line 494 hunk) and sampleFile.FileSize (line 676 hunk) are readily available on mydump.SourceFileMeta. Passing 0 forces these pre-import sampling paths to skip the new whole-file preload optimization entirely, undermining this PR's stated goal for the many-small-files case.

🐛 Proposed resolution (both sites)
-<<<<<<< HEAD
-		parser, err = mydump.NewParquetParser(
-			ctx, p.srcStorage, reader,
-			dataFileMeta.Path, mydump.ParquetFileMeta{},
-=======
 		parser, err = parquetfile.NewParser(
 			ctx, p.srcStorage, openReader,
-			dataFileMeta.Path, 0, parquetfile.FileMeta{},
->>>>>>> ab79433f43c (importer, mydump: preload small parquet files in a single read (`#68250`))
+			dataFileMeta.Path, dataFileMeta.FileSize, parquetfile.FileMeta{},
 		)
-<<<<<<< HEAD
-		parser, err = mydump.NewParquetParser(
-			ctx, p.srcStorage, reader,
-			sampleFile.Path, mydump.ParquetFileMeta{},
-=======
 		parser, err = parquetfile.NewParser(
 			ctx, p.srcStorage, openReader,
-			sampleFile.Path, 0, parquetfile.FileMeta{},
->>>>>>> ab79433f43c (importer, mydump: preload small parquet files in a single read (`#68250`))
+			sampleFile.Path, sampleFile.FileSize, parquetfile.FileMeta{},
 		)

Also applies to: 676-684

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lightning/pkg/importer/get_pre_info.go` around lines 494 - 502, Resolve the
merge conflicts in both parser-construction sites, removing all conflict markers
and retaining the intended parquetfile.NewParser integration. In the
dataFileMeta path and the sampleFile path, pass each SourceFileMeta’s actual
FileSize instead of 0, while preserving the appropriate reader and metadata
arguments so small-file preloading remains enabled.

Comment thread pkg/executor/importer/table_import.go Outdated
Comment on lines +346 to +352
<<<<<<< HEAD
func (ti *TableImporter) EstimateParquetReaderMemory(ctx context.Context, path string) (int64, error) {
return mydump.EstimateParquetReaderMemory(ctx, ti.LoadDataController.dataStore, path)
=======
func (ti *TableImporter) EstimateParquetReaderMemory(ctx context.Context, path string, fileSize int64) (int64, error) {
return parquetfile.EstimateParquetReaderMemory(ctx, ti.LoadDataController.dataStore, path, fileSize)
>>>>>>> ab79433f43c (importer, mydump: preload small parquet files in a single read (#68250))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Unresolved git merge-conflict markers left in source.

Same compile-breaking issue as the other files in this cohort — resolve to the parquetfile.EstimateParquetReaderMemory branch with the fileSize parameter.

🐛 Proposed resolution
-<<<<<<< HEAD
-func (ti *TableImporter) EstimateParquetReaderMemory(ctx context.Context, path string) (int64, error) {
-	return mydump.EstimateParquetReaderMemory(ctx, ti.LoadDataController.dataStore, path)
-=======
 func (ti *TableImporter) EstimateParquetReaderMemory(ctx context.Context, path string, fileSize int64) (int64, error) {
 	return parquetfile.EstimateParquetReaderMemory(ctx, ti.LoadDataController.dataStore, path, fileSize)
->>>>>>> ab79433f43c (importer, mydump: preload small parquet files in a single read (`#68250`))
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<<<<<<< HEAD
func (ti *TableImporter) EstimateParquetReaderMemory(ctx context.Context, path string) (int64, error) {
return mydump.EstimateParquetReaderMemory(ctx, ti.LoadDataController.dataStore, path)
=======
func (ti *TableImporter) EstimateParquetReaderMemory(ctx context.Context, path string, fileSize int64) (int64, error) {
return parquetfile.EstimateParquetReaderMemory(ctx, ti.LoadDataController.dataStore, path, fileSize)
>>>>>>> ab79433f43c (importer, mydump: preload small parquet files in a single read (#68250))
func (ti *TableImporter) EstimateParquetReaderMemory(ctx context.Context, path string, fileSize int64) (int64, error) {
return parquetfile.EstimateParquetReaderMemory(ctx, ti.LoadDataController.dataStore, path, fileSize)
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/executor/importer/table_import.go` around lines 346 - 352, Resolve the
merge conflict in TableImporter.EstimateParquetReaderMemory by removing the
conflict markers and retaining the parquetfile.EstimateParquetReaderMemory call
with the fileSize parameter. Update the method signature and delegation
consistently so the code compiles.

Comment thread pkg/lightning/mydump/parquet_parser_test.go Outdated
Comment on lines +38 to +41
// wholeFileInMemoryThreshold caps whole-file preloading. The lower limit
// keeps the per-parser memory cost bounded while retaining the object-store
// request reduction for small files.
wholeFileInMemoryThreshold = 32 * units.MiB

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Restore the intended 128 MiB whole-file threshold.

This sets 32 MiB, so files from 32–128 MiB miss the single-read preload path described by the PR objective.

Proposed fix
-	wholeFileInMemoryThreshold = 32 * units.MiB
+	wholeFileInMemoryThreshold = 128 * units.MiB
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// wholeFileInMemoryThreshold caps whole-file preloading. The lower limit
// keeps the per-parser memory cost bounded while retaining the object-store
// request reduction for small files.
wholeFileInMemoryThreshold = 32 * units.MiB
// wholeFileInMemoryThreshold caps whole-file preloading. The lower limit
// keeps the per-parser memory cost bounded while retaining the object-store
// request reduction for small files.
wholeFileInMemoryThreshold = 128 * units.MiB
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/lightning/mydump/parquet_wrapper.go` around lines 38 - 41, Update the
wholeFileInMemoryThreshold constant to 128 MiB so files up to the intended limit
use the whole-file preload path; leave the surrounding memory-bound and
object-store behavior unchanged.

Comment thread pkg/lightning/mydump/parquet_wrapper.go Outdated
Signed-off-by: Ruihao Chen <joechenrh@gmail.com>
@ti-chi-bot

Copy link
Copy Markdown
Member Author

Cherry-pick conflicts appear resolved; removing the do-not-merge/hold label.

@ti-chi-bot ti-chi-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 29, 2026
Signed-off-by: Ruihao Chen <joechenrh@gmail.com>
@ti-chi-bot ti-chi-bot Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/lightning/mydump/parquet_parser_test.go (1)

1393-1395: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Align the whole-file cutoff with the 128 MiB objective.

This test locks whole-file preloading to 32 MiB, but the PR objective requires files up to 128 MiB to be loaded with one read. Otherwise, 32–128 MiB files will continue down the row-group/multi-read path. Update the implementation and expected threshold together.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/lightning/mydump/parquet_parser_test.go` around lines 1393 - 1395, Update
wholeFileInMemoryThreshold and its assertion in
TestParquetParserWholeFileInMemory to 128 MiB, matching
rowGroupInMemoryThreshold, so files up to 128 MiB use the single-read whole-file
path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@pkg/lightning/mydump/parquet_parser_test.go`:
- Around line 1393-1395: Update wholeFileInMemoryThreshold and its assertion in
TestParquetParserWholeFileInMemory to 128 MiB, matching
rowGroupInMemoryThreshold, so files up to 128 MiB use the single-read whole-file
path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ad30c97-cbb6-470e-bc48-b2fe4bd1b439

📥 Commits

Reviewing files that changed from the base of the PR and between b98c3fc and 4fc7b25.

📒 Files selected for processing (6)
  • lightning/pkg/importer/chunk_process.go
  • lightning/pkg/importer/get_pre_info.go
  • pkg/executor/importer/table_import.go
  • pkg/lightning/mydump/parquet_parser.go
  • pkg/lightning/mydump/parquet_parser_test.go
  • pkg/lightning/mydump/parquet_wrapper.go

Signed-off-by: Ruihao Chen <joechenrh@gmail.com>
@codecov

codecov Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.95238% with 16 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-nextgen-202603@6b91e9d). Learn more about missing BASE report.

Additional details and impacted files
@@                     Coverage Diff                     @@
##             release-nextgen-202603     #70193   +/-   ##
===========================================================
  Coverage                          ?   76.2307%           
===========================================================
  Files                             ?       1937           
  Lines                             ?     541423           
  Branches                          ?          0           
===========================================================
  Hits                              ?     412731           
  Misses                            ?     128692           
  Partials                          ?          0           
Flag Coverage Δ
unit 76.2307% <80.9523%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 61.5065% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 48.8016% <0.0000%> (?)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 30, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, joechenrh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 30, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2026-07-30 06:02:29.682816655 +0000 UTC m=+2075935.718911721: ☑️ agreed by joechenrh.
  • 2026-07-30 06:14:10.368383421 +0000 UTC m=+2076636.404478477: ☑️ agreed by D3Hunter.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/lightning/mydump/parquet_parser_test.go (1)

1393-1395: 🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Align the whole-file threshold with the PR target.

Line 1394 locks whole-file preloading to 32 MiB, so files from 33 MiB through 128 MiB take the row-group path instead of the promised whole-file preload path. Set the whole-file threshold to 128 MiB and update this assertion, or revise the PR objective if 32 MiB is intentional. Based on the PR objective, whole-file preload is intended for files up to 128 MiB.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/lightning/mydump/parquet_parser_test.go` around lines 1393 - 1395, Update
wholeFileInMemoryThreshold to 128 MiB so whole-file preloading applies through
the intended limit, and change TestParquetParserWholeFileInMemory to assert the
new value while preserving the existing rowGroupInMemoryThreshold assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@pkg/lightning/mydump/parquet_parser_test.go`:
- Around line 1393-1395: Update wholeFileInMemoryThreshold to 128 MiB so
whole-file preloading applies through the intended limit, and change
TestParquetParserWholeFileInMemory to assert the new value while preserving the
existing rowGroupInMemoryThreshold assertion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4e8f1052-022d-417e-a34d-bda095856794

📥 Commits

Reviewing files that changed from the base of the PR and between a5db12e and 2487b19.

📒 Files selected for processing (2)
  • pkg/lightning/mydump/parquet_parser.go
  • pkg/lightning/mydump/parquet_parser_test.go

@ti-chi-bot
ti-chi-bot Bot merged commit b79ac99 into pingcap:release-nextgen-202603 Jul 30, 2026
18 checks passed
@ti-chi-bot
ti-chi-bot Bot deleted the cherry-pick-68250-to-release-nextgen-202603 branch July 30, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-nextgen-202603

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants