[ 
https://issues.apache.org/jira/browse/FLINK-28685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17571188#comment-17571188
 ] 

Paul Lin commented on FLINK-28685:
----------------------------------

Please assign this issue to me. I have fixed it in our in-house branch. Thanks!

> Optimize CatalogManager getTable implementation
> -----------------------------------------------
>
>                 Key: FLINK-28685
>                 URL: https://issues.apache.org/jira/browse/FLINK-28685
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / API
>    Affects Versions: 1.16.0
>            Reporter: Paul Lin
>            Priority: Major
>
> Currently, Catalog#getTable(ObjectPath) might be abused in CatalogManager. 
> CatalogManager gets an ObjectPath directly, instead of checking the existence 
> of the table first, which could surprise Catalog developers and may get 
> unexpected exceptions other than TableNotFoundExceptions.
> {code:java}
> private Optional<CatalogBaseTable> getUnresolvedTable(ObjectIdentifier 
> objectIdentifier) {
> Catalog currentCatalog = catalogs.get(objectIdentifier.getCatalogName());
> ObjectPath objectPath = objectIdentifier.toObjectPath();
> if (currentCatalog != null) {
> try
> { final CatalogBaseTable table = currentCatalog.getTable(objectPath); return 
> Optional.of(table); }
> catch (TableNotExistException e)
> { // Ignore. }
> }
> return Optional.empty();
> }{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to