[
https://issues.apache.org/jira/browse/BEAM-10407?focusedWorklogId=458214&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-458214
]
ASF GitHub Bot logged work on BEAM-10407:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Jul/20 17:45
Start Date: 13/Jul/20 17:45
Worklog Time Spent: 10m
Work Description: robinyqiu commented on a change in pull request #12237:
URL: https://github.com/apache/beam/pull/12237#discussion_r453821984
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubSchemaCapableIOProvider.java
##########
@@ -116,11 +116,21 @@ public Schema configurationSchema() {
public PubsubSchemaIO from(String location, Row configuration, Schema
dataSchema) {
validateConfigurationSchema(configuration);
validateDlq(configuration.getValue("deadLetterQueue"));
- validateEventTimestamp(dataSchema);
+ validateDataSchema(dataSchema);
return new PubsubSchemaIO(location, configuration, dataSchema);
}
- private void validateEventTimestamp(Schema schema) {
+ @Override
+ public Boolean requiresDataSchema() {
+ return true;
+ }
+
+ private void validateDataSchema(Schema schema) {
+ if (requiresDataSchema() && schema == null) {
Review comment:
Consider removing `requiresDataSchema()` because it is always true here?
I know this is the general logic but in this specific provider this call is
not necessary.
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/io/SchemaIOProvider.java
##########
@@ -47,5 +48,8 @@
* resides there, and some IO-specific configuration object. Can throw a
{@link
* InvalidConfigurationException} or a {@link InvalidSchemaException}.
*/
- SchemaIO from(String location, Row configuration, Schema dataSchema);
+ SchemaIO from(String location, Row configuration, @Nullable Schema
dataSchema);
+
+ /** Indicates whether the dataSchema value is necessary. */
+ Boolean requiresDataSchema();
Review comment:
Prefer return primitive `boolean` type?
----------------------------------------------------------------
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: 458214)
Time Spent: 2h 40m (was: 2.5h)
> Move Avro and Parquet provider logic to core beam
> -------------------------------------------------
>
> Key: BEAM-10407
> URL: https://issues.apache.org/jira/browse/BEAM-10407
> Project: Beam
> Issue Type: Improvement
> Components: sdk-java-core
> Reporter: Scott Lukas
> Assignee: Scott Lukas
> Priority: P2
> Labels: schema-io
> Time Spent: 2h 40m
> Remaining Estimate: 0h
>
> Implement SchemaIO and SchemaCapableIOProvider for Avro and Parquet.
> Additional details:
> [https://docs.google.com/document/d/1ic3P8EVGHIydHQ-VMDKbN9kEdwm7sBXMo80VrhwksvI/edit#heading=h.x9snb54sjlu9]
> [~bhulette]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)