[ 
https://issues.apache.org/jira/browse/FLINK-21635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17295979#comment-17295979
 ] 

Kezhu Wang commented on FLINK-21635:
------------------------------------

[~jark] Thank you for inspiration. I thought a bit and try to list possible 
candidates:
 * Change {{getDriverName}} to return {{Optional}}. BREAKING CHANGE.
 * Add `@Nullable` annotation. Compatible but inconsistent with {{getUsername}} 
and {{getPassword}}.
 * Add another method to return {{Optional}} and deprecate {{getDriverName}}.
 * Others ?

Currently the naming is quite inconsistent:
 * {{driver}}: {{JdbcDynamicTableFactory.DRIVER}}(public in table declaration).
 * {{drivername}}: {{JdbcInputFormat.JdbcInputFormatBuilder}} and 
{{JdbcOutputFormat.JdbcOutputFormatBuilder}} (both are {{Experimental}}), 
{{JdbcRowDataInputFormat.Builder}} ({{Internal}})
 * {{driverName}}: {{JdbcConnectionOptions}}({{PublicEvolving}})

May be we can rename all or last two to verbose {{driverClassName}} to solve 
this without introducing breaking change and inconsistent inside 
{{JdbcConnectionOptions}} ? {{driver}} is also an option, but I am a bit worry 
of conflicting in unknown future naming with code method {{Driver getDriver}} 
or something else.

> Driver name is optional for DriverManager.getConnection but a must in 
> JdbcConnectionOptions
> -------------------------------------------------------------------------------------------
>
>                 Key: FLINK-21635
>                 URL: https://issues.apache.org/jira/browse/FLINK-21635
>             Project: Flink
>          Issue Type: Improvement
>          Components: Connectors / JDBC
>    Affects Versions: 1.13.0
>            Reporter: Kezhu Wang
>            Priority: Major
>
> The most annoying/sad part is that we should change {{getDriverName}} to 
> {{Optional}} according to [code 
> style|https://flink.apache.org/contributing/code-style-and-quality-java.html#java-optional](which
>  is a breaking change in user side since {{JdbcConnectionOptions}} is 
> {{PublicEvolving}}) if we make {{driverName}} optional.
> cc [~jark] [~roman_khachatryan] [~lzljs3620320]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to