File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -778,6 +778,12 @@ public ReadRows withDataSourceConfiguration(DataSourceConfiguration config) {
778778
779779 public ReadRows withDataSourceProviderFn (
780780 SerializableFunction <Void , DataSource > dataSourceProviderFn ) {
781+ if (getDataSourceProviderFn () != null
782+ && !(getDataSourceProviderFn ()
783+ instanceof DataSourceProviderFromDataSourceConfiguration )) {
784+ LOG .warn (
785+ "Both withDataSourceConfiguration and withDataSourceProviderFn are provided. dataSourceProviderFn will override dataSourceConfiguration." );
786+ }
781787 return toBuilder ().setDataSourceProviderFn (dataSourceProviderFn ).build ();
782788 }
783789
@@ -948,6 +954,12 @@ public Read<T> withDataSourceConfiguration(final DataSourceConfiguration config)
948954
949955 public Read <T > withDataSourceProviderFn (
950956 SerializableFunction <Void , DataSource > dataSourceProviderFn ) {
957+ if (getDataSourceProviderFn () != null
958+ && !(getDataSourceProviderFn ()
959+ instanceof DataSourceProviderFromDataSourceConfiguration )) {
960+ LOG .warn (
961+ "Both withDataSourceConfiguration and withDataSourceProviderFn are provided. dataSourceProviderFn will override dataSourceConfiguration." );
962+ }
951963 return toBuilder ().setDataSourceProviderFn (dataSourceProviderFn ).build ();
952964 }
953965
You can’t perform that action at this time.
0 commit comments