[
https://issues.apache.org/jira/browse/BEAM-6674?focusedWorklogId=255861&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-255861
]
ASF GitHub Bot logged work on BEAM-6674:
----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Jun/19 11:41
Start Date: 07/Jun/19 11:41
Worklog Time Spent: 10m
Work Description: charithe commented on pull request #8725: [BEAM-6674]
Add schema support to JdbcIO read
URL: https://github.com/apache/beam/pull/8725#discussion_r291556575
##########
File path:
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java
##########
@@ -188,6 +191,15 @@
.build();
}
+ /** Read Beam {@link Row}s from a JDBC data source. */
+ @Experimental(Experimental.Kind.SCHEMAS)
+ public static ReadRows readRows() {
+ return new AutoValue_JdbcIO_ReadRows.Builder()
+ .setFetchSize(DEFAULT_FETCH_SIZE)
+ .setOutputParallelization(true)
+ .build();
+ }
Review comment:
So I assumed that it would be easy to obtain the schema for `T` and
implicitly attach it to the PCollection. However, this appears to be difficult
to do reliably unless the user explicitly provides a reference to `Class<T>` as
you correctly suggested.
Given that the user has to make a conscious effort to enable schema support
by providing a reference to `Class<T>`, wouldn't it make sense to introduce a
generic utility function such as `PCollections.withSchema(PCollection<T>,
Class<T>)` that would work for any kind of PCollection and not just the output
of JDBC IO?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 255861)
Time Spent: 2.5h (was: 2h 20m)
> The JdbcIO source should produce schemas
> ----------------------------------------
>
> Key: BEAM-6674
> URL: https://issues.apache.org/jira/browse/BEAM-6674
> Project: Beam
> Issue Type: Sub-task
> Components: io-java-jdbc
> Reporter: Reuven Lax
> Assignee: Shehzaad Nakhoda
> Priority: Major
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)