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


##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/cdc/sink/CdcWriteConfig.java:
##########
@@ -0,0 +1,231 @@
+/*
+ * 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.cdc.sink;
+
+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.io.Serializable;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import org.apache.beam.sdk.io.iceberg.cdc.IcebergCdcMetadataColumns;
+import org.apache.beam.sdk.values.ValueKind;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+/** Configuration for the CDC sink. */
+@AutoValue
+abstract class CdcWriteConfig implements Serializable {
+  static final String DEFAULT_SEQUENCE_NUMBER_COLUMN =
+      IcebergCdcMetadataColumns.COMMIT_SNAPSHOT_SEQUENCE_NUMBER;
+
+  /**
+   * Every shard that touches a partition writes a file per commit window, so 
{@code num_shards x
+   * touched partitions x windows per day} files. On a <b>partitioned</b> 
table {@link
+   * #getShardsPerPartition()} caps the per-partition factor without lowering 
this number, trading
+   * per-partition write parallelism for proportionally fewer files.
+   */
+  static final int DEFAULT_NUM_SHARDS = 16;
+
+  static final int DEFAULT_SORTER_MEMORY_MB = 100;
+
+  /**
+   * Columns that define a row's identity (the Iceberg equality-delete 
fields). If unspecified, will
+   * try to use the destination table's identifier fields.
+   */
+  abstract @Nullable List<String> getEqualityColumns();

Review Comment:
   "primary key" isn't in the Iceberg vocabulary, although the concept is 
similar.
   "Equality columns" is a write property. It defaults to the table's 
"identifier fields" by default, so it's similar in that sense, but it can be 
overridden for a given write operation.
   
   I'd rather keep it this way, it matches Spark and Flink too. Users will be 
familiar with it



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