[ 
https://issues.apache.org/jira/browse/BEAM-10494?focusedWorklogId=459967&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-459967
 ]

ASF GitHub Bot logged work on BEAM-10494:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Jul/20 21:32
            Start Date: 16/Jul/20 21:32
    Worklog Time Spent: 10m 
      Work Description: robinyqiu commented on a change in pull request #12266:
URL: https://github.com/apache/beam/pull/12266#discussion_r456089799



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/RowToPubsubMessage.java
##########
@@ -40,19 +39,14 @@
  * whether config.getValue("timestampAttributeKey") is set.
  */
 class RowToPubsubMessage extends PTransform<PCollection<Row>, 
PCollection<PubsubMessage>> {
-  private final Row config;
   private final Boolean useTimestampAttribute;
 
-  private RowToPubsubMessage(Row config, Boolean useFlatSchema, Boolean 
useTimestampAttribute) {
-    checkArgument(useFlatSchema, "RowToPubsubMessage is only supported for 
flattened schemas.");
-
-    this.config = config;
+  private RowToPubsubMessage(Boolean useTimestampAttribute) {

Review comment:
       Java coding style discourage using boxed primitive types, unless there 
are reasons. I think here it's better to just use `boolean`. Same below.

##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/RowToPubsubMessage.java
##########
@@ -40,19 +39,14 @@
  * whether config.getValue("timestampAttributeKey") is set.
  */
 class RowToPubsubMessage extends PTransform<PCollection<Row>, 
PCollection<PubsubMessage>> {
-  private final Row config;
   private final Boolean useTimestampAttribute;
 
-  private RowToPubsubMessage(Row config, Boolean useFlatSchema, Boolean 
useTimestampAttribute) {
-    checkArgument(useFlatSchema, "RowToPubsubMessage is only supported for 
flattened schemas.");
-
-    this.config = config;
+  private RowToPubsubMessage(Boolean useTimestampAttribute) {
     this.useTimestampAttribute = useTimestampAttribute;
   }
 
-  public static RowToPubsubMessage fromConfig(
-      Row config, Boolean useFlatSchema, Boolean useTimestampAttribute) {
-    return new RowToPubsubMessage(config, useFlatSchema, 
useTimestampAttribute);
+  public static RowToPubsubMessage fromConfig(Boolean useTimestampAttribute) {

Review comment:
       Nit: Now that `config` parameter is gone, this class could be better 
named as something more meaningful like `withTimestampAttribute()`.




----------------------------------------------------------------
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: 459967)
    Time Spent: 1h 20m  (was: 1h 10m)

> PubsubSchemaCapableIOProvider Config inner class
> ------------------------------------------------
>
>                 Key: BEAM-10494
>                 URL: https://issues.apache.org/jira/browse/BEAM-10494
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-go-gcp
>            Reporter: Scott Lukas
>            Assignee: Scott Lukas
>            Priority: P2
>              Labels: schema-io
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Use Schema inference to shift config values to an inferred object rather than 
> a Row within PubsubSchemaCapableIOProvider.
> Within project:
> [https://docs.google.com/document/d/1ic3P8EVGHIydHQ-VMDKbN9kEdwm7sBXMo80VrhwksvI/edit#heading=h.x9snb54sjlu9]
> [~bhulette]



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

Reply via email to