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 2023/01/13 07:12:39 UTC

[GitHub] [flink] LadyForest opened a new pull request, #21662: [FLINK-30668][table-api] Introduce ExplainFormat to Explainable and TableEnvironment

LadyForest opened a new pull request, #21662:
URL: https://github.com/apache/flink/pull/21662

   ## What is the purpose of the change
   
   This PR is the first subtask of [FLIP-280](https://cwiki.apache.org/confluence/display/FLINK/FLIP-280%3A+Introduce+EXPLAIN+PLAN_ADVICE+to+provide+SQL+advice) to introduce enum `ExplainFormat` to Public API  `Explainable` and `TableEnvironment`.
   
   
   ## Brief change log
   
   11b6f0af
     - Introduce an enum `ExplainFormat` to categorize the output format of EXPLAIN statement.
     - Add a new method`explain(ExplainFormat format, ExplainDetail... extraDetails)` to `Explainable`.  
     - Add a new method`explainSql(String statement, ExplainFormat format, ExplainDetail... extraDetails)` to `TableEnvironment`.
   
   
   ## Verifying this change
   
   This change is already covered by existing tests.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (**yes** / no)
     - The serializers: (yes / **no **/ don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / **no** / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduces a new feature? (**yes** / no)
     - If yes, how is the feature documented? FLINK-30673
   


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


[GitHub] [flink] flinkbot commented on pull request #21662: [FLINK-30668][table-api] Introduce ExplainFormat to Explainable and TableEnvironment

Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #21662:
URL: https://github.com/apache/flink/pull/21662#issuecomment-1381412375

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "11b6f0af858a62b540336df7102f8ef24aabc267",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "11b6f0af858a62b540336df7102f8ef24aabc267",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 11b6f0af858a62b540336df7102f8ef24aabc267 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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


[GitHub] [flink] lincoln-lil commented on a diff in pull request #21662: [FLINK-30668][table-api] Introduce ExplainFormat to Explainable and TableEnvironment

Posted by GitBox <gi...@apache.org>.
lincoln-lil commented on code in PR #21662:
URL: https://github.com/apache/flink/pull/21662#discussion_r1069021755


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/Explainable.java:
##########
@@ -36,7 +36,20 @@
      *     e.g. estimated cost, changelog mode for streaming
      * @return AST and the execution plan.
      */
-    String explain(ExplainDetail... extraDetails);
+    default String explain(ExplainDetail... extraDetails) {
+        return explain(ExplainFormat.TEXT, extraDetails);
+    }
+
+    /**
+     * Returns the AST of this object and the execution plan to compute the result of the given
+     * statement.
+     *
+     * @param format The output format of explain plan

Review Comment:
   nit: explained



##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/TableEnvironment.java:
##########
@@ -970,7 +970,21 @@ void createTemporarySystemFunction(
      *     estimated cost, changelog mode for streaming, displaying execution plan in json format
      * @return AST and the execution plan.
      */
-    String explainSql(String statement, ExplainDetail... extraDetails);
+    default String explainSql(String statement, ExplainDetail... extraDetails) {
+        return explainSql(statement, ExplainFormat.TEXT, extraDetails);
+    }
+
+    /**
+     * Returns the AST of the specified statement and the execution plan to compute the result of
+     * the given statement.
+     *
+     * @param statement The statement for which the AST and execution plan will be returned.
+     * @param format The output format of explain plan.

Review Comment:
   ditto



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


[GitHub] [flink] LadyForest commented on pull request #21662: [FLINK-30668][table-api] Introduce ExplainFormat to Explainable and TableEnvironment

Posted by GitBox <gi...@apache.org>.
LadyForest commented on PR #21662:
URL: https://github.com/apache/flink/pull/21662#issuecomment-1381496634

   @flinkbot run azure


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


[GitHub] [flink] lincoln-lil closed pull request #21662: [FLINK-30668][table-api] Introduce ExplainFormat to Explainable and TableEnvironment

Posted by GitBox <gi...@apache.org>.
lincoln-lil closed pull request #21662: [FLINK-30668][table-api] Introduce ExplainFormat to Explainable and TableEnvironment
URL: https://github.com/apache/flink/pull/21662


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