You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/08/07 02:03:34 UTC

[GitHub] [flink] WeiZhong94 commented on a change in pull request #13083: [FLINK-18838][python] Support JdbcCatalog in Python Table API

WeiZhong94 commented on a change in pull request #13083:
URL: https://github.com/apache/flink/pull/13083#discussion_r466777657



##########
File path: flink-python/pyflink/table/catalog.py
##########
@@ -996,3 +1114,16 @@ def __init__(self, catalog_name=None, default_database="default", hive_conf_dir=
             j_hive_catalog = gateway.jvm.org.apache.flink.table.catalog.hive.HiveCatalog(
                 catalog_name, default_database, hive_conf_dir)
         super(HiveCatalog, self).__init__(j_hive_catalog)
+
+
+class JdbcCatalog(Catalog):
+    """
+    A catalog implementation for Jdbc.
+    """
+    def __init__(self, catalog_name, default_database, username, pwd, base_url):

Review comment:
       add type hint for __init__ method? see https://www.python.org/dev/peps/pep-0484/#the-meaning-of-annotations

##########
File path: docs/dev/table/catalogs.zh.md
##########
@@ -268,11 +261,8 @@ table_properties = Kafka() \
     .start_from_earlist() \
     .to_properties()
 
-j_catalog_table = gateway.jvm.org.apache.flink.table.catalog.CatalogTableImpl(
-    table_schema._j_table_schema,
-    table_properties,
-    "my comment")
-catalog_table = CatalogBaseTable(j_catalog_table)
+catalog_table = CatalogBaseTable.create_table(
+    schema=table_schema, properties=table_properties, "my comment")

Review comment:
       add comment= ?

##########
File path: docs/dev/table/catalogs.md
##########
@@ -271,11 +264,8 @@ table_properties = Kafka() \
     .start_from_earlist() \
     .to_properties()
 
-j_catalog_table = gateway.jvm.org.apache.flink.table.catalog.CatalogTableImpl(
-    table_schema._j_table_schema,
-    table_properties,
-    "my comment")
-catalog_table = CatalogBaseTable(j_catalog_table)
+catalog_table = CatalogBaseTable.create_table(
+    schema=table_schema, properties=table_properties, "my comment")

Review comment:
       ditto




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

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