public boolean tableExists()

in src/main/java/org/apache/flink/connector/rocketmq/catalog/RocketMQCatalog.java [221:242]


    public boolean tableExists(ObjectPath tablePath) throws CatalogException {
        if (!getDefaultDatabase().equals(tablePath.getDatabaseName())) {
            throw new CatalogException("Database name is not default.");
        }
        if (StringUtils.isEmpty(tablePath.getObjectName())) {
            return false;
        }
        String subject = tablePath.getObjectName();
        try {
            GetSchemaResponse getSchemaResponse = schemaRegistryClient.getSchemaBySubject(subject);
            if (Objects.nonNull(getSchemaResponse)) {
                return true;
            }
        } catch (Exception e) {
            throw new CatalogException(
                    String.format(
                            "Failed to get schema of table %s from schema registry client.",
                            tablePath.getFullName()),
                    e);
        }
        return false;
    }