DanielCarter-stack commented on issue #10591:
URL: https://github.com/apache/seatunnel/issues/10591#issuecomment-4044182610
<!-- code-pr-reviewer -->
Valid architecture enhancement with clear code reuse value. **Current
limitation**: `OptionRule.Builder.conditional()` only accepts `Option<?>...`
parameters, and all `RequiredOption` implementations store `List<Option<?>>`
directly, preventing rule nesting.
**Evidence of duplication**: Identical format rules (Parquet/CSS) repeated
across multiple factories:
- `connector-file-hadoop/.../hdfs/sink/HdfsFileSinkFactory.java` (lines
88-92)
- `connector-file-oss/.../oss/sink/OssFileSinkFactory.java` (lines 86-90)
- `connector-file-s3/.../s3/sink/S3FileSinkFactory.java` (lines 82-87)
**Suggested API** (backward-compatible):
```java
public <T> Builder conditional(
@NonNull Option<T> conditionalOption,
@NonNull T expectValue,
@NonNull OptionRule nestedRule)
```
**Open questions**:
1. Should nesting support unlimited levels?
2. How should priority work when nested `optional()` conflicts with outer
`required()`?
3. Should `getOptionalOptions()`/`getRequiredOptions()` flatten nested
structures for UI display?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]