apache / apache/beam

[Feature Request]: Support Java 14 records in `SchemaCoder`

Open
#27,802 3 comments 0 reactions 0 assignees View on GitHub
awaiting triage java new feature P3 stale
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

### What would you like to happen?

The current `JavaBeanSchema` and `JavaFieldSchema` do not support working with Java 14 records by default because the record components are `private final` and the accessor methods do not conform to the Java bean convention (`field()` instead of `getField()`).

A new schema class for the schema coder could be created to support coding Java 14 records. Java records are especially well suited as intermediate data structures in beam pipelines because of their automatically generated `hash`, `equals`, and `toString` methods as well as their immutability. This would reduce boilerplate which inevitably causes issues down the line as everyone reimplements the same methods with varying degrees of correctness and uses code generation tools with poorly documented semantics.

### Issue Priority

Priority: 3 (nice-to-have improvement)

### Issue Components

- [ ] Component: Python SDK
- [X] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Samza Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.