Skip to content

chore(ci): Advance velox & Migrate presto-trunk from VectorSerde::Kind to string API#27262

Merged
han-yan01 merged 2 commits intoprestodb:masterfrom
han-yan01:export-D95243859
Mar 8, 2026
Merged

chore(ci): Advance velox & Migrate presto-trunk from VectorSerde::Kind to string API#27262
han-yan01 merged 2 commits intoprestodb:masterfrom
han-yan01:export-D95243859

Conversation

@han-yan01
Copy link
Copy Markdown
Contributor

@han-yan01 han-yan01 commented Mar 5, 2026

Summary:
Migrate all presto-trunk files from legacy VectorSerde::Kind enum
to the new string-based named serde API. This is stacked on D94569860
which adds the string API and legacy Kind overloads for backward compat.

Changes:

  • PrestoServer.cpp: use string names for serde registration checks
  • BroadcastFile.cpp: getNamedVectorSerde("Presto")
  • BroadcastWrite.cpp: getVectorSerdeOptions(..., "Presto")
  • ShuffleRead.cpp: ExchangeNode with "CompactRow"
  • BroadcastTest.cpp: exchange with "Presto"
  • TaskManagerTest.cpp: parameterize on std::string instead of Kind
  • PrestoToVeloxQueryPlan.cpp: toVeloxSerdeKind returns std::string
  • PlanConverterTest.cpp: compare serdeKind() with "CompactRow"

Differential Revision: D95243859

Releas Notes

== NO RELEASE NOTE ==

Summary by Sourcery

Migrate Presto native execution code from the legacy VectorSerde::Kind enum to the new string-based named serde API.

Enhancements:

  • Replace VectorSerde::Kind usage with string serde identifiers (e.g., "Presto", "CompactRow", "UnsafeRow") across Presto server, operators, and query plan conversion.
  • Update TaskManager tests and parameterization to use std::string serde names instead of the enum kind.
  • Adjust plan converter and related tests to expect string serde kinds for exchanges and partitioned output nodes.

@han-yan01 han-yan01 requested review from a team as code owners March 5, 2026 05:39
@prestodb-ci prestodb-ci added the from:Meta PR from Meta label Mar 5, 2026
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Mar 5, 2026

Reviewer's Guide

Migrates presto-native execution code from the legacy velox::VectorSerde::Kind enum to the new string-based named serde API, updating server registration, operators, plan conversion, and tests to use serde names like "Presto" and "CompactRow" instead of enum values.

Class diagram for migration to string-based VectorSerde API

classDiagram

class PrestoServer {
  +registerVectorSerdes() void
}

class BroadcastFileWriter {
  +BroadcastFileWriter(...) void
}

class BroadcastWriteOperator {
  +BroadcastWriteOperator(...) void
}

class ShuffleRead {
  +ShuffleRead(...) void
}

class VeloxQueryPlanConverterBase {
  +toVeloxQueryPlan(node, tableWriteInfo, taskId) core::PlanNodePtr
}

class VeloxBatchQueryPlanConverter {
  +toVeloxQueryPlan(node, tableWriteInfo, taskId) core::PlanFragment
}

class PrestoToVeloxQueryPlan {
  +toVeloxSerdeKind(encoding protocol::ExchangeEncoding) std::string
}

class VectorSerdeAPI {
  +isRegisteredVectorSerde() bool
  +isRegisteredNamedVectorSerde(name std::string) bool
  +getNamedVectorSerde(name std::string) VectorSerdeAPI
  +getVectorSerdeOptions(compressionKind, serdeName std::string) VectorSerdeOptions
}

class CoreExchangeNodes {
  +ExchangeNode(id, rowType, serdeName std::string)
  +PartitionedOutputNode(id, rowType, serdeName std::string)
}

PrestoServer ..> VectorSerdeAPI : registers_named_serdes
BroadcastFileWriter ..> VectorSerdeAPI : uses_getNamedVectorSerde
BroadcastWriteOperator ..> VectorSerdeAPI : uses_getVectorSerdeOptions
ShuffleRead ..> CoreExchangeNodes : creates_ExchangeNode_with_serdeName
VeloxQueryPlanConverterBase ..> CoreExchangeNodes : creates_PartitionedOutputNode_with_serdeName
VeloxBatchQueryPlanConverter ..> CoreExchangeNodes : creates_ExchangeNode_with_serdeName
PrestoToVeloxQueryPlan ..> CoreExchangeNodes : provides_serdeName
VeloxQueryPlanConverterBase ..> PrestoToVeloxQueryPlan : uses_toVeloxSerdeKind
VeloxBatchQueryPlanConverter ..> PrestoToVeloxQueryPlan : uses_toVeloxSerdeKind
PrestoServer ..> PrestoToVeloxQueryPlan : relies_on_serdeName_convention
Loading

File-Level Changes

Change Details Files
Switch TaskManager testing and cursor plumbing from VectorSerde::Kind to std::string serde identifiers
  • Change Cursor constructor and member to store serdeKind as std::string instead of VectorSerde::Kind
  • Update TaskManagerTest to parameterize WithParamInterface on std::string rather than VectorSerde::Kind
  • Replace enum-based test parameters with string values "Presto", "CompactRow", and "UnsafeRow"
presto-native-execution/presto_cpp/main/tests/TaskManagerTest.cpp
Update Presto-to-Velox query plan conversion to use string serde names
  • Change toVeloxSerdeKind to return std::string and map ExchangeEncoding::COLUMNAR to "Presto" and ROW_WISE to "CompactRow"
  • Update PartitionedOutputNode construction to pass "Presto" serde name
  • Update VeloxBatchQueryPlanConverter broadcast paths to construct ExchangeNode with "Presto" instead of VectorSerde::Kind::kPresto
presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.cpp
Migrate broadcast and shuffle operators and tests to string-based serde naming
  • Update BroadcastTest plan building to call PlanBuilder::exchange with "Presto" instead of VectorSerde::Kind::kPresto
  • Change BroadcastFileWriter to call getNamedVectorSerde("Presto")
  • Change BroadcastWriteOperator to call getVectorSerdeOptions(..., "Presto")
  • Update ShuffleRead to construct ExchangeNode with "CompactRow" instead of VectorSerde::Kind::kCompactRow
presto-native-execution/presto_cpp/main/operators/tests/BroadcastTest.cpp
presto-native-execution/presto_cpp/main/operators/BroadcastFile.cpp
presto-native-execution/presto_cpp/main/operators/BroadcastWrite.cpp
presto-native-execution/presto_cpp/main/operators/ShuffleRead.cpp
Use string-based named serde registration in PrestoServer
  • Replace isRegisteredNamedVectorSerde checks that used VectorSerde::Kind enum values with checks using serde name strings "Presto", "CompactRow", and "UnsafeRow"
presto-native-execution/presto_cpp/main/PrestoServer.cpp
Align plan converter tests with string serde names
  • Update PlanConverterTest to assert partitionedOutput->serdeKind() equals "CompactRow" instead of VectorSerde::Kind::kCompactRow
presto-native-execution/presto_cpp/main/types/tests/PlanConverterTest.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Now that serde kinds are plain strings in multiple places (e.g., "Presto", "CompactRow", "UnsafeRow" across tests, plan conversion, and server registration), consider centralizing these as named constants or an enum-like helper to avoid typos and keep the set of valid serde names consistent.
  • The function toVeloxSerdeKind in PrestoToVeloxQueryPlan.cpp now returns std::string; renaming it (e.g., to toVeloxSerdeName or similar) would better reflect its behavior and reduce confusion with the legacy VectorSerde::Kind.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Now that serde kinds are plain strings in multiple places (e.g., "Presto", "CompactRow", "UnsafeRow" across tests, plan conversion, and server registration), consider centralizing these as named constants or an enum-like helper to avoid typos and keep the set of valid serde names consistent.
- The function `toVeloxSerdeKind` in `PrestoToVeloxQueryPlan.cpp` now returns `std::string`; renaming it (e.g., to `toVeloxSerdeName` or similar) would better reflect its behavior and reduce confusion with the legacy `VectorSerde::Kind`.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Summary:
Migrate all presto-trunk files from legacy VectorSerde::Kind enum
to the new string-based named serde API. This is stacked on D94569860
which adds the string API and legacy Kind overloads for backward compat.

Changes:
- PrestoServer.cpp: use string names for serde registration checks
- BroadcastFile.cpp: getNamedVectorSerde("Presto")
- BroadcastWrite.cpp: getVectorSerdeOptions(..., "Presto")
- ShuffleRead.cpp: ExchangeNode with "CompactRow"
- BroadcastTest.cpp: exchange with "Presto"
- TaskManagerTest.cpp: parameterize on std::string instead of Kind
- PrestoToVeloxQueryPlan.cpp: toVeloxSerdeKind returns std::string
- PlanConverterTest.cpp: compare serdeKind() with "CompactRow"

Differential Revision: D95243859
@amitkdutta
Copy link
Copy Markdown
Contributor

@han-yan01 You need to advance velox in this PR

@han-yan01 han-yan01 changed the title Migrate presto-trunk from VectorSerde::Kind to string API chore(ci): Advance velox & Migrate presto-trunk from VectorSerde::Kind to string API Mar 8, 2026
Copy link
Copy Markdown
Contributor

@amitkdutta amitkdutta left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks @han-yan01

@han-yan01 han-yan01 merged commit 9c230da into prestodb:master Mar 8, 2026
141 of 147 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants