flink-cdc
flink-cdc copied to clipboard
[hotfix] Guard Optional.get() in Doris connector schema lookups
What this PR does
Replaces bare Optional.get() calls with Optional.orElseThrow() in the Doris pipeline connector to provide meaningful error messages when columns are missing from the schema.
Affected files
DorisMetadataApplier.java— column lookup during schema evolutionDorisSchemaUtils.java— partition key column lookup
Why
Optional.get() throws a bare NoSuchElementException with no context when the Optional is empty. This makes debugging difficult when a primary key or partition key column is unexpectedly missing (e.g., after schema evolution). Using orElseThrow() with a descriptive message including the column name makes failures immediately diagnosable.
Testing
Behavioral change only in the error path — happy-path behavior is unchanged.
Split from #4427 as requested by @yuxiqian.