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 01:38:57 UTC

[GitHub] [flink] dianfu opened a new pull request #13083: [FLINK-18838][python] Support JdbcCatalog in Python Table API

dianfu opened a new pull request #13083:
URL: https://github.com/apache/flink/pull/13083


   
   ## What is the purpose of the change
   
   *This pull request add support JdbcCatalog in Python Table API. It also add a few static methods used for creating CatalogFunction, CatalogDatabase, CatalogTable, etc*
   
   ## Brief change log
   
     - *Introduce JdbcCatalog*
     - *Add a few static methods used for creating CatalogFunction, CatalogDatabase, CatalogTable*
   
   ## Verifying this change
   
   This change is already covered by existing tests in test_catalog.py*.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes)
     - If yes, how is the feature documented? (docs)
   


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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13083:
URL: https://github.com/apache/flink/pull/13083#issuecomment-670276466


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 19051add632f730aacb77364b685b9174074458a (Fri Aug 07 01:49:25 UTC 2020)
   
   **Warnings:**
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-18838).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13083: [FLINK-18838][python] Support JdbcCatalog in Python Table API

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13083:
URL: https://github.com/apache/flink/pull/13083#issuecomment-670281607


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "19051add632f730aacb77364b685b9174074458a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5262",
       "triggerID" : "19051add632f730aacb77364b685b9174074458a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ba39c1d4173aa7aebdc7348464ff8cea3d9d012e",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5266",
       "triggerID" : "ba39c1d4173aa7aebdc7348464ff8cea3d9d012e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 19051add632f730aacb77364b685b9174074458a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5262) 
   * ba39c1d4173aa7aebdc7348464ff8cea3d9d012e Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5266) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



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

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13083:
URL: https://github.com/apache/flink/pull/13083#issuecomment-670281607


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "19051add632f730aacb77364b685b9174074458a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "19051add632f730aacb77364b685b9174074458a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 19051add632f730aacb77364b685b9174074458a UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13083: [FLINK-18838][python] Support JdbcCatalog in Python Table API

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13083:
URL: https://github.com/apache/flink/pull/13083#issuecomment-670281607


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "19051add632f730aacb77364b685b9174074458a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5262",
       "triggerID" : "19051add632f730aacb77364b685b9174074458a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ba39c1d4173aa7aebdc7348464ff8cea3d9d012e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ba39c1d4173aa7aebdc7348464ff8cea3d9d012e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 19051add632f730aacb77364b685b9174074458a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5262) 
   * ba39c1d4173aa7aebdc7348464ff8cea3d9d012e UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] dianfu closed pull request #13083: [FLINK-18838][python] Support JdbcCatalog in Python Table API

Posted by GitBox <gi...@apache.org>.
dianfu closed pull request #13083:
URL: https://github.com/apache/flink/pull/13083


   


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



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

Posted by GitBox <gi...@apache.org>.
dianfu commented on pull request #13083:
URL: https://github.com/apache/flink/pull/13083#issuecomment-670283241


   @WeiZhong94 Thanks for the review. 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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13083: [FLINK-18838][python] Support JdbcCatalog in Python Table API

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13083:
URL: https://github.com/apache/flink/pull/13083#issuecomment-670281607


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "19051add632f730aacb77364b685b9174074458a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5262",
       "triggerID" : "19051add632f730aacb77364b685b9174074458a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ba39c1d4173aa7aebdc7348464ff8cea3d9d012e",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5266",
       "triggerID" : "ba39c1d4173aa7aebdc7348464ff8cea3d9d012e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ba39c1d4173aa7aebdc7348464ff8cea3d9d012e Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5266) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #13083: [FLINK-18838][python] Support JdbcCatalog in Python Table API

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13083:
URL: https://github.com/apache/flink/pull/13083#issuecomment-670281607


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "19051add632f730aacb77364b685b9174074458a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5262",
       "triggerID" : "19051add632f730aacb77364b685b9174074458a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ba39c1d4173aa7aebdc7348464ff8cea3d9d012e",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5266",
       "triggerID" : "ba39c1d4173aa7aebdc7348464ff8cea3d9d012e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 19051add632f730aacb77364b685b9174074458a Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5262) 
   * ba39c1d4173aa7aebdc7348464ff8cea3d9d012e Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5266) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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