Skip to content

[GLUTEN][VL] Fix redundant copies in Delta DV plan conversion#12389

Merged
zhztheplayer merged 1 commit into
apache:mainfrom
iemejia:gluten-delta-perf-cpp
Jul 3, 2026
Merged

[GLUTEN][VL] Fix redundant copies in Delta DV plan conversion#12389
zhztheplayer merged 1 commit into
apache:mainfrom
iemejia:gluten-delta-perf-cpp

Conversation

@iemejia

@iemejia iemejia commented Jun 29, 2026

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Fix two minor inefficiencies in VeloxPlanConverter.cc (parseDeltaSplitInfo):

  1. Double dynamic_pointer_cast: the original code called dynamic_pointer_cast<DeltaSplitInfo> twice (once in the ternary condition, once in the true branch). Changed to a single cast + null check.

  2. Unnecessary std::string copy from protobuf: the accessor serialized_deletion_vector() returns a const std::string& to the internal protobuf field, but auto (by value) triggered a full string copy into a local variable. Changed to const auto& to bind directly to the protobuf internal field, eliminating the intermediate copy.

How was this patch tested?

  • Existing C++ Delta unit tests (19 tests in velox_delta_read_test): all pass
  • DeltaDeletionVectorScanInfoSuite: pass
  • VeloxDeltaSuite: pass

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude claude-opus-4.6

VeloxPlanConverter.cc (parseDeltaSplitInfo):
- Fix double dynamic_pointer_cast: the original code called
  dynamic_pointer_cast<DeltaSplitInfo> twice (once in the ternary
  condition, once in the true branch). Use a single cast + null check.
- Avoid unnecessary std::string copy from protobuf: the accessor
  serialized_deletion_vector() returns a const std::string& to the
  internal protobuf field, but 'auto' (by value) triggered a full
  string copy into a local variable. Changed to 'const auto&' to
  bind directly to the protobuf internal field, eliminating the
  intermediate copy. The shared_ptr<string> construction then copies
  once from the reference (unavoidable since it needs ownership).

Assisted-by: GitHub Copilot:claude-opus-4.6
Copilot AI review requested due to automatic review settings June 29, 2026 07:58
@github-actions github-actions Bot added the VELOX label Jun 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves parseDeltaSplitInfo in the Velox backend plan conversion path by removing redundant work during Delta deletion vector (DV) split parsing, reducing unnecessary overhead in hot code.

Changes:

  • Avoid repeated std::dynamic_pointer_cast<DeltaSplitInfo> by performing a single cast and null-check.
  • Avoid an intermediate local std::string materialization from the protobuf DV payload by binding the protobuf field as const auto& and copying directly into the owned payload buffer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zhztheplayer zhztheplayer merged commit dfcf437 into apache:main Jul 3, 2026
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants