Add helper class to generate schemas directly
- Dominant language
- Java
- Stars
- 2.1k
- Forks
- 625
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 97
Description
### Search before asking
- [x] I searched in the [issues](https://github.com/apache/fluss/issues) and found nothing similar.
### Description
Schemas currently have to be written manually by user, [example](https://github.com/ververica/ververica-fluss-examples/blob/main/fluss-food-delivery/src/main/java/com/ververica/models/FoodDeliveryDomain.java#L50):
```
return Schema.newBuilder()
.column("orderId", DataTypes.STRING())
.column("courierId", DataTypes.STRING())
.column("restaurantId", DataTypes.STRING())
.column("destinationLatitude", DataTypes.DOUBLE())
.column("destinationLongitude", DataTypes.DOUBLE())
.column("estimatedPrepTimeSeconds", DataTypes.BIGINT())
.column("estimatedTravelTimeSeconds", DataTypes.BIGINT())
.column("eventTimestamp", DataTypes.TIMESTAMP())
.build();
```
We can improve user experience by introducing helper method for this. For example, a method can be added under `Schema`
```
Schema.fromClass(Class class)
```
### Willingness to contribute
- [x] I'm willing to submit a PR!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Schema API and the example class FoodDeliveryDomain.java linked in the issue. Determine the intended behavior and supported class-to-schema mapping for Schema.fromClass; done means a helper can generate the equivalent schema without manually declaring each column.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100