You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "ahmedabu98 (via GitHub)" <gi...@apache.org> on 2023/04/27 05:37:09 UTC

[GitHub] [beam] ahmedabu98 commented on a diff in pull request #26384: Add field annotations for high-priority Syndeo schema transforms

ahmedabu98 commented on code in PR #26384:
URL: https://github.com/apache/beam/pull/26384#discussion_r1178637008


##########
sdks/java/io/file-schema-transform/src/main/java/org/apache/beam/sdk/io/fileschematransform/FileWriteSchemaTransformConfiguration.java:
##########
@@ -51,43 +52,41 @@ public static XmlConfiguration.Builder xmlConfigurationBuilder() {
         .setCharset(StandardCharsets.UTF_8.name());
   }
 
-  /**
-   * The format of the file content. Used as String key lookup of {@link
-   * FileWriteSchemaTransformFormatProviders#loadProviders()}.
-   */
+  @SchemaFieldDescription(
+      "The format of the file content. Value must be one of: \"avro\", \"csv\", \"json\", \"parquet\", \"xml\"")
   public abstract String getFormat();
 
-  /** A common prefix to use for all generated filenames. */
+  @SchemaFieldDescription("A common prefix to use for all generated filenames.")
   public abstract String getFilenamePrefix();
 
-  /**
-   * The compression of all generated shard files. By default, appends the respective extension to
-   * the filename. See {@link org.apache.beam.sdk.io.Compression} for expected values.
-   */
+  /** See {@link org.apache.beam.sdk.io.Compression} for expected values. */
+  @SchemaFieldDescription(
+      "The compression of all generated shard files. By default, appends the respective extension to the filename.")

Review Comment:
   Can you add a link to https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/io/Compression.html for expected inputs?



##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/providers/BigQueryDirectReadSchemaTransformProvider.java:
##########
@@ -123,15 +124,22 @@ public static Builder builder() {
           .Builder();
     }
 
+    @SchemaFieldDescription("The SQL query to be executed to read from the BigQuery table.")
     @Nullable
     public abstract String getQuery();
 
+    @SchemaFieldDescription(
+        "The BigQuery table to read from. Format: [${PROJECT}:]${DATASET}.${TABLE}")
     @Nullable
     public abstract String getTableSpec();
 
+    @SchemaFieldDescription(
+        "The Google standard SQL expression to read only the rows matched from the specified filter. If no value is specified, then all rows are returned.")
     @Nullable
     public abstract String getRowRestriction();
 
+    @SchemaFieldDescription(
+        "Read only the specified fields (columns) from a BigQuery table. Fields may not be returned in the order specified. If no value is specified, then all fields are returned.")
     @Nullable
     public abstract List<String> getSelectedFields();

Review Comment:
   How does Syndeo allow users to input a list? should that be mentioned in the description?



##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/providers/BigQueryDirectReadSchemaTransformProvider.java:
##########
@@ -123,15 +124,22 @@ public static Builder builder() {
           .Builder();
     }
 
+    @SchemaFieldDescription("The SQL query to be executed to read from the BigQuery table.")
     @Nullable
     public abstract String getQuery();
 
+    @SchemaFieldDescription(
+        "The BigQuery table to read from. Format: [${PROJECT}:]${DATASET}.${TABLE}")

Review Comment:
   ```suggestion
           "The fully-qualified name of the BigQuery table to read from. Format: [${PROJECT}:]${DATASET}.${TABLE}")
   ```



##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/providers/BigQueryDirectReadSchemaTransformProvider.java:
##########
@@ -123,15 +124,22 @@ public static Builder builder() {
           .Builder();
     }
 
+    @SchemaFieldDescription("The SQL query to be executed to read from the BigQuery table.")
     @Nullable
     public abstract String getQuery();
 
+    @SchemaFieldDescription(
+        "The BigQuery table to read from. Format: [${PROJECT}:]${DATASET}.${TABLE}")
     @Nullable
     public abstract String getTableSpec();
 
+    @SchemaFieldDescription(
+        "The Google standard SQL expression to read only the rows matched from the specified filter. If no value is specified, then all rows are returned.")

Review Comment:
   ```suggestion
           "Read only rows that match this filter, which must be compatible with Google standard SQL. This is not supported when reading via query.")
   ```



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org