FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Support multiple field projection, by names and indexes for Pojo (#649) by JunWang222 · Pull Request #710 · apache/wayang · GitHub

/ wayang Public

Support multiple field projection, by names and indexes for Pojo (#649) - #710

Open
JunWang222 wants to merge 1 commit into
apache:mainfrom
JunWang222:feature/projection-descriptor-multi-field
Open

JunWang222 wants to merge 1 commit into
apache:mainfrom
JunWang222:feature/projection-descriptor-multi-field

Conversation

JunWang222 commented Mar 2, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

issue#649 Revise implementation to support multiple field projection, by names

  • Add MultiFieldPojoImplementation static class following the existing PojoImplementation and RecordImplementation pattern
  • Add createForPojoByNames() factory for projecting multiple POJO fields by name into a Record
  • Add createForPojoByIndexes() factory for projecting POJO fields by their declared index into a Record
  • Restore RecordImplementation and createRecordJavaImplementation for consistency with the original codebase style
  • Add 9 new tests covering multi-field by name, by index, field reordering, null values, out-of-bounds, and nonexistent field error cases

Plan
Add a new MultiFieldPojoImplementation class following the same pattern as the existing PojoImplementation and RecordImplementation. It takes multiple field names, extracts each field from the input POJO via reflection, and packs the values into a Record.
Expose it through two new factory methods — one for field names, one for indexes — and keep the existing single-field path untouched for backward compatibility. The existing constructor routes automatically:

  • one field → old PojoImplementation (returns the raw value, same behavior as before)
  • multiple fields → new MultiFieldPojoImplementation (returns a Record).

- Add MultiFieldPojoImplementation static class following the existing
  PojoImplementation and RecordImplementation pattern
- Add createForPojoByNames() factory for projecting multiple POJO fields
  by name into a Record
- Add createForPojoByIndexes() factory for projecting POJO fields by
  their declared index into a Record
- Restore RecordImplementation and createRecordJavaImplementation for
  consistency with the original codebase style
- Add 9 new tests covering multi-field by name, by index, field reordering,
  null values, out-of-bounds, and nonexistent field error cases
JunWang222 changed the title Add multi-field and index-based POJO projection to ProjectionDescriptor Support multiple field projection, by names and indexes (#649) Mar 2, 2026
JunWang222 changed the title Support multiple field projection, by names and indexes (#649) Support multiple field projection, by names and indexes for Pojo (#649) Mar 2, 2026
zkaoudi requested a review from mspruc March 4, 2026 08:01

mspruc commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

@zkaoudi I see you asked me for review, what's the intended usage here for POJOs? I think implementation in the PR is fine but I have some concerns about the type system, in the PR we wrap the output in Record but I assume that the output of the operator also wraps in Record would this be intended behaviour?

mspruc commented May 19, 2026

Copy link
Copy Markdown
Contributor

Hi, would it be possible for you to implement an integration test for you multi POJOs?

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL