svetakvsundhar commented on code in PR #34417:
URL: https://github.com/apache/beam/pull/34417#discussion_r2012184767
##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcReadSchemaTransformProvider.java:
##########
@@ -213,25 +214,67 @@ protected JdbcIO.DataSourceConfiguration
dataSourceConfiguration() {
@Override
public PCollectionRowTuple expand(PCollectionRowTuple input) {
- String query = config.getReadQuery();
- if (query == null) {
- query = String.format("SELECT * FROM %s", config.getLocation());
- }
- JdbcIO.ReadRows readRows =
-
JdbcIO.readRows().withDataSourceConfiguration(dataSourceConfiguration()).withQuery(query);
- Integer fetchSize = config.getFetchSize();
- if (fetchSize != null && fetchSize > 0) {
- readRows = readRows.withFetchSize(fetchSize);
+
+ boolean readQueryPresent =
+ (config.getReadQuery() != null && !"".equals(config.getReadQuery()));
+ boolean locationPresent = (config.getLocation() != null &&
!"".equals(config.getLocation()));
+
+ if (readQueryPresent && locationPresent) {
Review Comment:
can you leave a comment here as to why we need this?
--
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]