You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "wuchong (via GitHub)" <gi...@apache.org> on 2023/03/19 10:18:40 UTC

[GitHub] [flink] wuchong opened a new pull request, #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

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

   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   The PR continues the work started at https://github.com/apache/flink/pull/22175
   
   This PR does this for `ShowOperation`s and `DescribeTableOperation`.
   
   ## Brief change log
   
   - Migrate `ShowOperation` to extend `ExecutableOperation` and move it's execution logic out from `TableEnvironmentImpl`.
   - `DescribeTableOperation` is  a special case of `ShowColumnsOperation`, so we migrate it in this PR as well.
   
   
   ## Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   ## 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, Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / **no**)
     - If yes, how is the feature documented? (**not applicable** / docs / JavaDocs / not documented)
   


-- 
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] wuchong commented on pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "wuchong (via GitHub)" <gi...@apache.org>.
wuchong commented on PR #22215:
URL: https://github.com/apache/flink/pull/22215#issuecomment-1477759897

   Merging... 


-- 
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] wuchong commented on a diff in pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "wuchong (via GitHub)" <gi...@apache.org>.
wuchong commented on code in PR #22215:
URL: https://github.com/apache/flink/pull/22215#discussion_r1141571108


##########
flink-table/flink-sql-gateway/src/test/resources/sql/table.q:
##########
@@ -31,12 +31,12 @@ org.apache.flink.table.api.ValidationException: Table with identifier 'default_c
 
 describe non_exist;
 !output
-org.apache.flink.table.api.ValidationException: Tables or views with the identifier 'default_catalog.default_database.non_exist' doesn't exist
+org.apache.flink.table.api.ValidationException: Tables or views with the identifier 'default_catalog.default_database.non_exist' doesn't exist.
 !error
 
 desc non_exist;
 !output
-org.apache.flink.table.api.ValidationException: Tables or views with the identifier 'default_catalog.default_database.non_exist' doesn't exist
+org.apache.flink.table.api.ValidationException: Tables or views with the identifier 'default_catalog.default_database.non_exist' doesn't exist.

Review Comment:
   Yes, this is missed. I just fixed it and rebased it to master. 



-- 
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] wuchong closed pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "wuchong (via GitHub)" <gi...@apache.org>.
wuchong closed pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl
URL: https://github.com/apache/flink/pull/22215


-- 
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] chucheng92 commented on a diff in pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "chucheng92 (via GitHub)" <gi...@apache.org>.
chucheng92 commented on code in PR #22215:
URL: https://github.com/apache/flink/pull/22215#discussion_r1141568929


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/ExecutableOperation.java:
##########
@@ -57,5 +59,9 @@ interface Context {
         FunctionCatalog getFunctionCatalog();
 
         ModuleManager getModuleManager();
+
+        ResourceManager getResourceManager();

Review Comment:
   it looks like we can get catalog and module or jars. how about showJobs ?



-- 
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] snuyanzin commented on a diff in pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #22215:
URL: https://github.com/apache/flink/pull/22215#discussion_r1141518683


##########
flink-table/flink-sql-gateway/src/test/resources/sql/table.q:
##########
@@ -31,12 +31,12 @@ org.apache.flink.table.api.ValidationException: Table with identifier 'default_c
 
 describe non_exist;
 !output
-org.apache.flink.table.api.ValidationException: Tables or views with the identifier 'default_catalog.default_database.non_exist' doesn't exist
+org.apache.flink.table.api.ValidationException: Tables or views with the identifier 'default_catalog.default_database.non_exist' doesn't exist.
 !error
 
 desc non_exist;
 !output
-org.apache.flink.table.api.ValidationException: Tables or views with the identifier 'default_catalog.default_database.non_exist' doesn't exist
+org.apache.flink.table.api.ValidationException: Tables or views with the identifier 'default_catalog.default_database.non_exist' doesn't exist.

Review Comment:
   it looks like same should be applied for sql client's version



-- 
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] wuchong commented on pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "wuchong (via GitHub)" <gi...@apache.org>.
wuchong commented on PR #22215:
URL: https://github.com/apache/flink/pull/22215#issuecomment-1476225146

   Yes, @chucheng92 , the new implementation also sorts the table list (in the useLike block).  


-- 
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] chucheng92 commented on pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "chucheng92 (via GitHub)" <gi...@apache.org>.
chucheng92 commented on PR #22215:
URL: https://github.com/apache/flink/pull/22215#issuecomment-1476215855

   @snuyanzin pls see master: https://github.com/apache/flink/blob/master/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java  listTables().


-- 
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] chucheng92 commented on pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "chucheng92 (via GitHub)" <gi...@apache.org>.
chucheng92 commented on PR #22215:
URL: https://github.com/apache/flink/pull/22215#issuecomment-1476227930

   > Yes, @chucheng92 , the new implementation also sorts the table list (in the useLike block).
   
   Sorry, found that in the useLike block.  looks good from my side


-- 
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] chucheng92 commented on a diff in pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "chucheng92 (via GitHub)" <gi...@apache.org>.
chucheng92 commented on code in PR #22215:
URL: https://github.com/apache/flink/pull/22215#discussion_r1141572379


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/ShowTablesOperation.java:
##########
@@ -104,4 +112,33 @@ public String asSummaryString() {
         }
         return builder.toString();
     }
+
+    @Override
+    public TableResultInternal execute(Context ctx) {
+        final Set<String> tables;
+        if (preposition == null) {
+            tables = ctx.getCatalogManager().listTables();

Review Comment:
   hi. there is a different point from previous behavior. the previous way
   return sorted result. 
   ```java
           return catalogManager.listTables().stream().sorted().toArray(String[]::new);
   ```
   
   Not just show tables, other operations may also occur. it may pass the current test, but true behavior is changed. So we should be careful to check the result by `getCatalogManager`.
   



##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/ExecutableOperation.java:
##########
@@ -57,5 +59,9 @@ interface Context {
         FunctionCatalog getFunctionCatalog();
 
         ModuleManager getModuleManager();
+
+        ResourceManager getResourceManager();

Review Comment:
   thanks. got 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: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] wuchong commented on pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "wuchong (via GitHub)" <gi...@apache.org>.
wuchong commented on PR #22215:
URL: https://github.com/apache/flink/pull/22215#issuecomment-1476076132

   Hi @snuyanzin , @chucheng92 , I have fixed the tests. Do you have other concerns? 


-- 
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] chucheng92 commented on a diff in pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "chucheng92 (via GitHub)" <gi...@apache.org>.
chucheng92 commented on code in PR #22215:
URL: https://github.com/apache/flink/pull/22215#discussion_r1141566179


##########
flink-table/flink-sql-gateway/src/test/resources/sql/table.q:
##########
@@ -31,12 +31,12 @@ org.apache.flink.table.api.ValidationException: Table with identifier 'default_c
 
 describe non_exist;
 !output
-org.apache.flink.table.api.ValidationException: Tables or views with the identifier 'default_catalog.default_database.non_exist' doesn't exist
+org.apache.flink.table.api.ValidationException: Tables or views with the identifier 'default_catalog.default_database.non_exist' doesn't exist.
 !error
 
 desc non_exist;
 !output
-org.apache.flink.table.api.ValidationException: Tables or views with the identifier 'default_catalog.default_database.non_exist' doesn't exist
+org.apache.flink.table.api.ValidationException: Tables or views with the identifier 'default_catalog.default_database.non_exist' doesn't exist.

Review Comment:
   +1 flink-sql-client-test need to add this either. then CliClientITCase will call to run 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: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] chucheng92 commented on pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "chucheng92 (via GitHub)" <gi...@apache.org>.
chucheng92 commented on PR #22215:
URL: https://github.com/apache/flink/pull/22215#issuecomment-1476189063

   > Hi @snuyanzin , @chucheng92 , I have fixed the tests. Do you have other concerns?
   
   Hi. Jark. please see my note above.  ShowTable should return sorted results like previous behavior.
   ```
    tables = ctx.getCatalogManager().listTables();
   ```


-- 
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] wuchong commented on a diff in pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "wuchong (via GitHub)" <gi...@apache.org>.
wuchong commented on code in PR #22215:
URL: https://github.com/apache/flink/pull/22215#discussion_r1141572325


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/ExecutableOperation.java:
##########
@@ -57,5 +59,9 @@ interface Context {
         FunctionCatalog getFunctionCatalog();
 
         ModuleManager getModuleManager();
+
+        ResourceManager getResourceManager();

Review Comment:
   Currently, `ShowJobsOperation` is implemented in SQL Gateway, not in `TableEnvironemntImpl`. And it relies on the additional `JobClient` to fetch jobs that require more effort. So I would like to migrate it in another issue. 



-- 
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 #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #22215:
URL: https://github.com/apache/flink/pull/22215#issuecomment-1475193654

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "6394390004154065ba20e69c1fea06ea5a93e41f",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "6394390004154065ba20e69c1fea06ea5a93e41f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 6394390004154065ba20e69c1fea06ea5a93e41f 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] snuyanzin commented on pull request #22215: [FLINK-31507][table] Move execution logic of ShowOperation out from TableEnvironmentImpl

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on PR #22215:
URL: https://github.com/apache/flink/pull/22215#issuecomment-1476209570

   @chucheng92 may be I missed something, however I wonder if it's not sorted here https://github.com/apache/flink/pull/22215/files#diff-745d3739f888f4a240798978a54933ff1a7d8d48b96a1e9472c7a9007c9f523aR132-R142


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