yuzelin commented on code in PR #2783:
URL: https://github.com/apache/paimon/pull/2783#discussion_r1580541835


##########
paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/action/cdc/CdcSourceRecord.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * 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.paimon.flink.action.cdc;
+
+import org.apache.paimon.annotation.Experimental;
+
+import javax.annotation.Nullable;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/** A data change record from the CDC source. */
+@Experimental

Review Comment:
   I think it's just an internal implementation, so we don't need to annotate 
'Experimental'.



##########
paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/action/cdc/format/RecordParser.java:
##########
@@ -86,26 +89,21 @@ public RecordParser(
     }
 
     @Nullable
-    public Schema buildSchema(String record) {
-        try {
-            setRoot(record);
-            if (isDDL()) {
-                return null;
-            }
-
-            Optional<RichCdcMultiplexRecord> recordOpt = 
extractRecords().stream().findFirst();
-            if (!recordOpt.isPresent()) {
-                return null;
-            }
-
-            Schema.Builder builder = Schema.newBuilder();
-            recordOpt.get().fieldTypes().forEach(builder::column);
-            builder.primaryKey(extractPrimaryKeys());
-            return builder.build();
-        } catch (Exception e) {
-            logInvalidJsonString(record);

Review Comment:
   I think it's better to keep this. We catch all exception to log the original 
record for trouble shooting.



##########
paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/action/cdc/format/RecordParser.java:
##########
@@ -126,21 +124,16 @@ protected LinkedHashMap<String, DataType> 
fillDefaultTypes(JsonNode record) {
     }
 
     @Override
-    public void flatMap(String value, Collector<RichCdcMultiplexRecord> out) {
-        try {
-            setRoot(value);
-            extractRecords().forEach(out::collect);
-        } catch (Exception e) {
-            logInvalidJsonString(value);

Review Comment:
   Same as above.



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