You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Paul Lin (Jira)" <ji...@apache.org> on 2022/07/26 04:27:00 UTC

[jira] [Commented] (FLINK-28685) Optimize CatalogManager getTable implementation

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