You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "hehuiyuan (via GitHub)" <gi...@apache.org> on 2023/12/18 08:23:10 UTC

[PR] Reduce getTable call for hive client and optimize graph generation time [flink]

hehuiyuan opened a new pull request, #23945:
URL: https://github.com/apache/flink/pull/23945

   
   ## What is the purpose of the change
   
   HiveCatalog.getHiveTable method wastes a lot of time when generate graph, because the number of calls  is relatively high.
   
   
   I have an sql task with over 2000 rows,  the HiveCatalog.getHiveTable  method is called 4879 times , but only six hive tables were used. 
   
   ![image](https://github.com/apache/flink/assets/18002496/d5f0daf3-f80a-4790-ae21-4e75dff9cfd7)
   
   The client.getTable method costs a lot of time.  One call takes approximately 50 milliseconds,
   
   4879 * 50 =243950ms  = 243.95s  = 4min
   
   ## Brief change log
   
   Reduce getTable call for hive client by using cache.
   
   
   ## Verifying this change
   
   
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / no)
     - The serializers: (yes / no / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / no / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
     - The S3 file system connector: (yes / no / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
   


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-33871][HIVE]Reduce getTable call for hive client and optimize graph generation time [flink]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #23945: [FLINK-33871][HIVE]Reduce getTable call for hive client and optimize graph generation time
URL: https://github.com/apache/flink/pull/23945


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-33871][HIVE]Reduce getTable call for hive client and optimize graph generation time [flink]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23945:
URL: https://github.com/apache/flink/pull/23945#issuecomment-2849035652

   This PR has been closed since it has not had any activity in 120 days. 
   If you feel like this was a mistake, or you would like to continue working on it, 
   please feel free to re-open the PR and ask for a review.


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-33871][HIVE]Reduce getTable call for hive client and optimize graph generation time [flink]

Posted by "hehuiyuan (via GitHub)" <gi...@apache.org>.
hehuiyuan commented on code in PR #23945:
URL: https://github.com/apache/flink/pull/23945#discussion_r1432229793


##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java:
##########
@@ -310,6 +313,10 @@ public void open() throws CatalogException {
                             "Configured default database %s doesn't exist in catalog %s.",
                             getDefaultDatabase(), getName()));
         }
+
+        if (cacheTable == null) {

Review Comment:
   Hi , this has no special design and we can directly use cache without going through open method.
   
   Just like `client`, open method initialization and close method cleaning



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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-33871][HIVE]Reduce getTable call for hive client and optimize graph generation time [flink]

Posted by "JingGe (via GitHub)" <gi...@apache.org>.
JingGe commented on code in PR #23945:
URL: https://github.com/apache/flink/pull/23945#discussion_r1430023059


##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java:
##########
@@ -310,6 +313,10 @@ public void open() throws CatalogException {
                             "Configured default database %s doesn't exist in catalog %s.",
                             getDefaultDatabase(), getName()));
         }
+
+        if (cacheTable == null) {

Review Comment:
   Would you please help me understand why lazy init is required in this case? Afaik, without calling the open() the catalog can not be used.



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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-33871][HIVE]Reduce getTable call for hive client and optimize graph generation time [flink]

Posted by "hehuiyuan (via GitHub)" <gi...@apache.org>.
hehuiyuan commented on PR #23945:
URL: https://github.com/apache/flink/pull/23945#issuecomment-1859780343

   @luoyuxia ping..


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-33871][HIVE]Reduce getTable call for hive client and optimize graph generation time [flink]

Posted by "JingGe (via GitHub)" <gi...@apache.org>.
JingGe commented on PR #23945:
URL: https://github.com/apache/flink/pull/23945#issuecomment-1939954816

   Could you please add test too? Thanks!


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-33871][HIVE]Reduce getTable call for hive client and optimize graph generation time [flink]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23945:
URL: https://github.com/apache/flink/pull/23945#issuecomment-2774622248

   This PR is being marked as stale since it has not had any activity in the last 90 days. 
   If you would like to keep this PR alive, please leave a comment asking for a review. 
   If the PR has merge conflicts, update it with the latest from the base branch.
   
   If you are having difficulty finding a reviewer, please reach out to the 
   community, contact details can be found here: https://flink.apache.org/what-is-flink/community/
   
   If this PR is no longer valid or desired, please feel free to close it. 
   If no activity occurs in the next 30 days, it will be automatically closed.


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-33871][HIVE]Reduce getTable call for hive client and optimize graph generation time [flink]

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #23945:
URL: https://github.com/apache/flink/pull/23945#issuecomment-1859784457

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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-33871][HIVE]Reduce getTable call for hive client and optimize graph generation time [flink]

Posted by "hehuiyuan (via GitHub)" <gi...@apache.org>.
hehuiyuan commented on code in PR #23945:
URL: https://github.com/apache/flink/pull/23945#discussion_r1432229793


##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java:
##########
@@ -310,6 +313,10 @@ public void open() throws CatalogException {
                             "Configured default database %s doesn't exist in catalog %s.",
                             getDefaultDatabase(), getName()));
         }
+
+        if (cacheTable == null) {

Review Comment:
   Hi , this has no special design and we can directly use cache without going through open method.



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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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