Hisoka-X commented on code in PR #6953:
URL: https://github.com/apache/seatunnel/pull/6953#discussion_r1631142981


##########
seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/utils/RowConverter.java:
##########
@@ -462,4 +470,24 @@ public static InternalRow reconvert(
         }
         return binaryRow;
     }
+
+    private static void checkCanWriteWithType(
+            int i, SeaTunnelRowType seaTunnelRowType, List<DataField> fields) {
+        String sourceFieldName = seaTunnelRowType.getFieldName(i);
+        SeaTunnelDataType<?> sourceFieldType = 
seaTunnelRowType.getFieldType(i);
+        DataField sinkDataField = fields.get(i);
+        DataType exceptDataType =
+                RowTypeConverter.reconvert(sourceFieldName, 
seaTunnelRowType.getFieldType(i));
+        DataField exceptDataField = new DataField(i, sourceFieldName, 
exceptDataType);
+        DataType sinkDataType = sinkDataField.type();
+        // Check typeRoot

Review Comment:
   ```suggestion
   ```



##########
seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonError.java:
##########
@@ -245,4 +247,28 @@ public static SeaTunnelRuntimeException unsupportedRowKind(
         params.put("rowKind", rowKind);
         return new SeaTunnelRuntimeException(UNSUPPORTED_ROW_KIND, params);
     }
+
+    public static SeaTunnelRuntimeException 
writeRowErrorWithSchemaIncompatibleSchema(
+            String connector,
+            String sourceFieldSqlSchema,
+            String exceptFieldSqlSchema,
+            String sinkFieldSqlSchema) {
+        Map<String, String> params = new HashMap<>();
+        params.put("connector", connector);
+        params.put("sourceFieldSqlSchema", sourceFieldSqlSchema);
+        params.put("exceptFieldSqlSchema", exceptFieldSqlSchema);
+        params.put("sinkFieldSqlSchema", sinkFieldSqlSchema);
+        return new SeaTunnelRuntimeException(
+                WRITE_SEATUNNEL_ROW_ERROR_WITH_SCHEMA_INCOMPATIBLE_SCHEMA, 
params);
+    }
+
+    public static SeaTunnelRuntimeException writeRowErrorWithFiledsNotMatch(

Review Comment:
   ```suggestion
       public static SeaTunnelRuntimeException 
writeRowErrorWithFiledsCountNotMatch(
   ```



##########
seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonErrorCode.java:
##########
@@ -62,7 +62,15 @@ public enum CommonErrorCode implements SeaTunnelErrorCode {
             "COMMON-28",
             "'<identifier>' array type not support genericType '<genericType>' 
of '<fieldName>'"),
     UNSUPPORTED_ROW_KIND(
-            "COMMON-29", "'<identifier>' table '<tableId>' not support rowKind 
 '<rowKind>'");
+            "COMMON-29", "'<identifier>' table '<tableId>' not support rowKind 
 '<rowKind>'"),
+
+    WRITE_SEATUNNEL_ROW_ERROR_WITH_SCHEMA_INCOMPATIBLE_SCHEMA(
+            "COMMON-30",
+            "<connector>: The source filed with sql schema 
'<sourceFieldSqlSchema>', except sql schema of sink is 
'<exceptFieldSqlSchema>'; but the filed in sink table which actual sql schema 
is '<sinkFieldSqlSchema>'. Please check schema of sink table."),

Review Comment:
   Not all connectors use sql.
   ```suggestion
               "<connector>: The source filed with schema 
'<sourceFieldSqlSchema>', except schema of sink is '<exceptFieldSqlSchema>'; 
but the filed in sink table which actual schema is '<sinkFieldSqlSchema>'. 
Please check schema of sink table."),
   ```



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/java/org/apache/seatunnel/e2e/connector/paimon/PaimonIT.java:
##########
@@ -35,6 +36,7 @@
 
 @DisabledOnContainer(
         value = TestContainerId.FLINK_1_13,
+        type = {EngineType.FLINK, EngineType.SPARK},

Review Comment:
   Any reason for change this?



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