You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "FangYongs (via GitHub)" <gi...@apache.org> on 2023/06/26 11:33:02 UTC

[GitHub] [flink] FangYongs opened a new pull request, #22869: [FLINK-32403][table] Add database related operations in CatalogManager

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

   ## What is the purpose of the change
   
   This PR aims to add database operations in CatalogManager, then Create/Alter/DropDatabaseOperation can use catalog manager to do some operations for database and we can add a listener in catalog manager for them later.
   
   ## Brief change log
     - Add create/alter/drop database method in catalog manager
     - Use catalog manager for database in Create/Alter/DropDatabaseOperation
   
   ## 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) no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / no) no
     - The serializers: (yes / no / don't know) no
     - The runtime per-record code paths (performance sensitive): (yes / no / don't know) no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know) no
     - The S3 file system connector: (yes / no / don't know) no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / no) 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] PatrickRen commented on a diff in pull request #22869: [FLINK-32403][table] Add database related operations in CatalogManager

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


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/ddl/AlterDatabaseOperation.java:
##########
@@ -70,10 +69,13 @@ public String asSummaryString() {
 
     @Override
     public TableResultInternal execute(Context ctx) {
-        Catalog catalog = ctx.getCatalogManager().getCatalogOrThrowException(getCatalogName());
         try {
-            catalog.alterDatabase(getDatabaseName(), getCatalogDatabase(), false);
+            ctx.getCatalogManager()
+                    .alterDatabase(
+                            getCatalogName(), getDatabaseName(), getCatalogDatabase(), false);
             return TableResultImpl.TABLE_RESULT_OK;
+        } catch (ValidationException e) {
+            throw e;

Review Comment:
   Do we need to catch the `ValidationException` if we just re-throw it without any additional action? Same question as in `CreateDatabaseOperation` and `DropDatabaseOperation`. 



-- 
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] FangYongs commented on pull request #22869: [FLINK-32403][table] Add database related operations in CatalogManager

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

   Hi @libenchao Please help to review this PR, thanks


-- 
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] PatrickRen merged pull request #22869: [FLINK-32403][table] Add database related operations in CatalogManager

Posted by "PatrickRen (via GitHub)" <gi...@apache.org>.
PatrickRen merged PR #22869:
URL: https://github.com/apache/flink/pull/22869


-- 
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 #22869: [FLINK-32403][table] Add database related operations in CatalogManager

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "4a48a366ac06c73eef65a3b0764884617afcc2a9",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4a48a366ac06c73eef65a3b0764884617afcc2a9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4a48a366ac06c73eef65a3b0764884617afcc2a9 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] FangYongs commented on a diff in pull request #22869: [FLINK-32403][table] Add database related operations in CatalogManager

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


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/ddl/AlterDatabaseOperation.java:
##########
@@ -70,10 +69,13 @@ public String asSummaryString() {
 
     @Override
     public TableResultInternal execute(Context ctx) {
-        Catalog catalog = ctx.getCatalogManager().getCatalogOrThrowException(getCatalogName());
         try {
-            catalog.alterDatabase(getDatabaseName(), getCatalogDatabase(), false);
+            ctx.getCatalogManager()
+                    .alterDatabase(
+                            getCatalogName(), getDatabaseName(), getCatalogDatabase(), false);
             return TableResultImpl.TABLE_RESULT_OK;
+        } catch (ValidationException e) {
+            throw e;

Review Comment:
   Thanks @PatrickRen , I have checked the exception in above operations and I think we can remove the re-throw for ValidationException directly. I have updated the PR 🙂



##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/ddl/AlterDatabaseOperation.java:
##########
@@ -70,10 +69,13 @@ public String asSummaryString() {
 
     @Override
     public TableResultInternal execute(Context ctx) {
-        Catalog catalog = ctx.getCatalogManager().getCatalogOrThrowException(getCatalogName());
         try {
-            catalog.alterDatabase(getDatabaseName(), getCatalogDatabase(), false);
+            ctx.getCatalogManager()
+                    .alterDatabase(
+                            getCatalogName(), getDatabaseName(), getCatalogDatabase(), false);
             return TableResultImpl.TABLE_RESULT_OK;
+        } catch (ValidationException e) {
+            throw e;

Review Comment:
   Thanks @PatrickRen , I have checked the exception in above operations and I think we can remove the re-throw for ValidationException directly. I have updated the PR 🙂



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