misi1987107 commented on code in PR #9227:
URL: https://github.com/apache/seatunnel/pull/9227#discussion_r2092649212


##########
seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sql/zeta/ZetaSQLEngine.java:
##########
@@ -280,8 +282,17 @@ private Object[] project(Object[] inputFields) {
                 }
             } else {
                 Expression expression = selectItem.getExpression();
-                fields[idx] = zetaSQLFunction.computeForValue(expression, 
inputFields);
-                idx++;
+                try {
+                    fields[idx] = zetaSQLFunction.computeForValue(expression, 
inputFields);
+                    idx++;
+                } catch (Exception e) {
+                    if (e instanceof TransformException) {
+                        throw e;

Review Comment:
   I previously thought that the computeForValue() method threw a 
TransformException(), so I should throw it outward.But I found this exception 
can be merged in the upper layer.



##########
seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/exception/TransformCommonError.java:
##########
@@ -67,4 +68,11 @@ public static TransformException 
cannotFindInputTableError(String transform, Str
         params.put("transform", transform);
         return new TransformException(INPUT_TABLE_NOT_FOUND, params);
     }
+
+    public static TransformException sqlTransformError(String transform, 
String expression) {

Review Comment:
   get it



##########
seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/exception/TransformCommonErrorCode.java:
##########
@@ -34,7 +34,10 @@ public enum TransformCommonErrorCode implements 
SeaTunnelErrorCode {
             "The metadata mapping field '<field>' of '<transform>' transform 
already exists in upstream schema"),
     INPUT_TABLE_NOT_FOUND(
             "TRANSFORM_COMMON-05",
-            "The input table '<table>' of '<transform>' transform not found in 
upstream schema");
+            "The input table '<table>' of '<transform>' transform not found in 
upstream schema"),
+    EXPRESSION_EXECUTE_ERROR(
+            "TRANSFORM_COMMON-06",
+            "The expression '<expression>' of '<transform>' transform execute 
failed");

Review Comment:
   get 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