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


##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/IcebergSchemaTransformCatalogConfig.java:
##########
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.sdk.io.iceberg;
+
+import static 
org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkArgument;
+
+import com.google.auto.value.AutoValue;
+import java.util.Set;
+import org.apache.beam.sdk.schemas.AutoValueSchema;
+import org.apache.beam.sdk.schemas.NoSuchSchemaException;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.SchemaRegistry;
+import org.apache.beam.sdk.schemas.annotations.DefaultSchema;
+import org.apache.beam.sdk.schemas.annotations.SchemaFieldDescription;
+import org.apache.beam.sdk.util.Preconditions;
+import org.apache.beam.sdk.values.Row;
+import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Strings;
+import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.Sets;
+import org.apache.iceberg.CatalogUtil;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+@DefaultSchema(AutoValueSchema.class)
+@AutoValue
+public abstract class IcebergSchemaTransformCatalogConfig {
+  public static Builder builder() {
+    return new AutoValue_IcebergSchemaTransformCatalogConfig.Builder();
+  }
+
+  public abstract String getCatalogName();
+
+  @SchemaFieldDescription("Valid types are: {hadoop, hive, rest}")
+  public abstract @Nullable String getCatalogType();
+
+  public abstract @Nullable String getCatalogImplementation();
+
+  public abstract @Nullable String getWarehouseLocation();
+
+  @AutoValue.Builder
+  public abstract static class Builder {
+
+    public abstract Builder setCatalogName(String catalogName);
+
+    public abstract Builder setCatalogType(String catalogType);
+
+    public abstract Builder setCatalogImplementation(String 
catalogImplementation);
+
+    public abstract Builder setWarehouseLocation(String warehouseLocation);
+
+    public abstract IcebergSchemaTransformCatalogConfig build();
+  }
+
+  public static final Schema SCHEMA;
+
+  static {
+    try {
+      SCHEMA =
+          SchemaRegistry.createDefault()
+              .getSchema(IcebergSchemaTransformCatalogConfig.class)
+              .sorted()
+              .toSnakeCase();

Review Comment:
   Done. 
   Wondering if there's a way to make it more known that we are setting this 
convention (ie. lexicographically sorted field names, snake_case)



-- 
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]

Reply via email to