You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/01/31 15:02:45 UTC

[GitHub] [flink] slinkydeveloper commented on a change in pull request #18572: [FLINK-25895][table-planner] Splitted ExecNodeGraphJsonPlanGenerator

slinkydeveloper commented on a change in pull request #18572:
URL: https://github.com/apache/flink/pull/18572#discussion_r795755557



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/ExecNodeGraphValidator.java
##########
@@ -0,0 +1,50 @@
+/*
+ * 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.flink.table.planner.plan.nodes.exec;
+
+import org.apache.flink.table.api.ValidationException;
+import org.apache.flink.table.planner.plan.nodes.exec.serde.JsonSerdeUtil;
+import org.apache.flink.table.planner.plan.nodes.exec.stream.StreamExecLookupJoin;
+import org.apache.flink.table.planner.plan.nodes.exec.visitor.AbstractExecNodeExactlyOnceVisitor;
+
+/** This class validates the {@link ExecNodeGraph}. */
+public class ExecNodeGraphValidator extends AbstractExecNodeExactlyOnceVisitor {
+
+    @Override
+    protected void visitNode(ExecNode<?> node) {
+        // TODO should we keep this? It seems like it's just checking that the nodes are correctly
+        //  developed by us...

Review comment:
       @twalthr @matriv any opinions about this?

##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/ExecNodeGraphValidator.java
##########
@@ -0,0 +1,50 @@
+/*
+ * 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.flink.table.planner.plan.nodes.exec;
+
+import org.apache.flink.table.api.ValidationException;
+import org.apache.flink.table.planner.plan.nodes.exec.serde.JsonSerdeUtil;
+import org.apache.flink.table.planner.plan.nodes.exec.stream.StreamExecLookupJoin;
+import org.apache.flink.table.planner.plan.nodes.exec.visitor.AbstractExecNodeExactlyOnceVisitor;
+
+/** This class validates the {@link ExecNodeGraph}. */
+public class ExecNodeGraphValidator extends AbstractExecNodeExactlyOnceVisitor {
+
+    @Override
+    protected void visitNode(ExecNode<?> node) {
+        // TODO should we keep this? It seems like it's just checking that the nodes are correctly
+        //  developed by us...
+        if (!JsonSerdeUtil.hasJsonCreatorAnnotation(node.getClass())) {
+            throw new ValidationException(
+                    String.format(
+                            "%s does not implement @JsonCreator annotation on constructor.",
+                            node.getClass().getCanonicalName()));
+        }
+        if (node instanceof StreamExecLookupJoin) {
+            // TODO Does this validation makes sense?
+            //  Is more reasonable to just make sure that a TemporalTableSourceSpec cannot be
+            //  instantiated without a DynamicTableSourceSpec?

Review comment:
       @twalthr @matriv any opinions about 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: issues-unsubscribe@flink.apache.org

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