You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/03/29 04:07:43 UTC

[GitHub] [incubator-seatunnel] bigdataf commented on a change in pull request #1603: [Feature] [transform] To quickly locate the wrong SQL statement in flink sql transform

bigdataf commented on a change in pull request #1603:
URL: https://github.com/apache/incubator-seatunnel/pull/1603#discussion_r837035958



##########
File path: seatunnel-transforms/seatunnel-transforms-flink/seatunnel-transform-flink-sql/src/main/java/org/apache/seatunnel/flink/transform/Sql.java
##########
@@ -42,16 +42,26 @@
     private static final String SQL = "sql";
 
     @Override
-    public DataStream<Row> processStream(FlinkEnvironment env, DataStream<Row> dataStream) {
+    public DataStream<Row> processStream(FlinkEnvironment env, DataStream<Row> dataStream) throws Exception {
         StreamTableEnvironment tableEnvironment = env.getStreamTableEnvironment();
-        Table table = tableEnvironment.sqlQuery(sql);
+        Table table = null;
+        try {
+            table = tableEnvironment.sqlQuery(sql);
+        } catch (Exception e) {
+            throw new Exception(sql, e.getCause());
+        }

Review comment:
       @ruanwenjun 
   Yes,thanks for your advice,you mean for example like this?
   `throw new Exception("Flink SQL transform execute failed, SQL:"+sql, e);`




-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org