You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "mygrsun (via GitHub)" <gi...@apache.org> on 2024/08/09 12:55:17 UTC
[PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
mygrsun opened a new pull request, #4469:
URL: https://github.com/apache/gravitino/pull/4469
<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
Examples:
- "[#123] feat(operator): support xxx"
- "[#233] fix: check null before access result in xxx"
- "[MINOR] refactor: fix typo in variable name"
- "[MINOR] docs: fix typo in README"
- "[#255] test: fix flaky test NameOfTheTest"
Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. If the PR is unfinished, please mark this PR as draft.
-->
### What changes were proposed in this pull request?
the problem of slow acquisition of hive table list.
Using listTableNamesByFilter replace the getTableObjectsByName method.
### Why are the changes needed?
I found that list-table will takes 300s when a schema has 5000 tables .
Fix: #4089
### Does this PR introduce _any_ user-facing change?
no
### How was this patch tested?
Manual testing
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#issuecomment-2295596790
@FANNG1 @yuqi1129 Can you help review it?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mygrsun (via GitHub)" <gi...@apache.org>.
mygrsun commented on PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#issuecomment-2301183891
Now,the ci issue is a troublesome problem. https://github.com/apache/gravitino/actions/runs/10452698362/job/28942732918?pr=4469
This ci issue is due to a bug in hive, and the iceberg project has the same proble.
https://github.com/apache/iceberg/pull/2722#issuecomment-867363019
<img width="1317" alt="image" src="https://github.com/user-attachments/assets/ef24311e-36a8-409c-938e-1c8766c3acfa">
This hive bug is only happen in Derby. In our environment , the metastore storage is mysql,so we don't encounter this problem.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1718406748
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -557,23 +556,18 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
+ String filter =
+ String.format(
+ "%stable_type = \"ICEBERG\"", hive_metastoreConstants.HIVE_FILTER_FIELD_PARAMS);
Review Comment:
If we do not filter the view, what impact will it have on Gravitino?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao merged PR #4469:
URL: https://github.com/apache/gravitino/pull/4469
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1711484590
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -557,23 +556,18 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
+ String filter =
+ String.format(
+ "%stable_type = \"ICEBERG\"", hive_metastoreConstants.HIVE_FILTER_FIELD_PARAMS);
Review Comment:
Filtering out only the Iceberg table seems to be insufficient, and we currently also do not support view type.
So I think you should use show managed type table when `listAllTables=false`
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1827559243
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -539,23 +538,32 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
Review Comment:
Based on [the source codes of Paimon ](https://github.com/apache/paimon/blob/76f906faad4a155f75f6db52a5c0014d532b2c55/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java#L1021)and tested locally, I updated the PR and use table param `table_type=paimon` to filter out Paimon tables.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#issuecomment-2376279251
@mygrsun Is there any progress? May I take on this?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mygrsun (via GitHub)" <gi...@apache.org>.
mygrsun commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1724430186
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -557,23 +556,18 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
+ String filter =
+ String.format(
+ "%stable_type = \"ICEBERG\"", hive_metastoreConstants.HIVE_FILTER_FIELD_PARAMS);
Review Comment:
Now,the ci issue is a troublesome problem. https://github.com/apache/gravitino/actions/runs/10452698362/job/28942732918?pr=4469
This ci issue is due to a bug in hive, and the iceberg project has the same proble.
https://github.com/apache/iceberg/pull/2722#issuecomment-867363019
<img width="1240" alt="image" src="https://github.com/user-attachments/assets/4b49b466-dc17-4749-89c4-1f7267aa90e7">
This hive bug is only happen in Derby. In our environment , the metastore storage is mysql,so we don't encounter this problem.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1827627805
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -539,23 +538,32 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
+ // The reason for using the listTableNamesByFilter function is that the
+ // getTableObjectiesByName function has poor performance. Currently, we focus on the
+ // Iceberg, Paimon and Hudi table. In the future, if necessary, we will need to filter out
+ // other tables. In addition, the current return also includes tables of type VIRTUAL-VIEW.
+ String icebergAndPaimonFilter = getIcebergAndPaimonFilter();
+ List<String> icebergAndPaimonTables =
+ clientPool.run(
+ c ->
+ c.listTableNamesByFilter(
+ schemaIdent.name(), icebergAndPaimonFilter, (short) -1));
Review Comment:
fixed
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#issuecomment-2283304491
Hi, @mygrsun could you plz resolve the comment and CI issue? 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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mygrsun (via GitHub)" <gi...@apache.org>.
mygrsun commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1724430186
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -557,23 +556,18 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
+ String filter =
+ String.format(
+ "%stable_type = \"ICEBERG\"", hive_metastoreConstants.HIVE_FILTER_FIELD_PARAMS);
Review Comment:
Now,the ci issue is a troublesome problem. https://github.com/apache/gravitino/actions/runs/10452698362/job/28942732918?pr=4469
This ci issue is due to a bug in hive, and the iceberg project has the same proble.
https://github.com/apache/iceberg/pull/2722#issuecomment-867363019
<img width="1240" alt="image" src="https://github.com/user-attachments/assets/4b49b466-dc17-4749-89c4-1f7267aa90e7">
This hive bug is only happen in Derby. In our environment , the metastore storage is mysql,so we don't encounter this problem.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mygrsun (via GitHub)" <gi...@apache.org>.
mygrsun commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1716537692
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -557,23 +556,18 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
+ String filter =
+ String.format(
+ "%stable_type = \"ICEBERG\"", hive_metastoreConstants.HIVE_FILTER_FIELD_PARAMS);
Review Comment:
I found the listTableNamesByFilter can’t support filter by table type.so , this method can't meet the requirement of filting view tables.
<img width="824" alt="image" src="https://github.com/user-attachments/assets/4b3a02d0-394b-4b11-a79c-09d58511a635">
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#issuecomment-2451755419
I have verified locally that through this PR, the time consumption of listing 1000 tables can be reduced from **2043ms** to **14ms**.
It's ready for review now. @jerryshao
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1827135468
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -539,23 +538,32 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
Review Comment:
@mchades I think you should also check Paimon catalog, AFAIK, I have supported Paimon with HMS backend recently. Please sync with @FANNG1 and @caican00 .
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1827599836
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -539,23 +538,32 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
+ // The reason for using the listTableNamesByFilter function is that the
+ // getTableObjectiesByName function has poor performance. Currently, we focus on the
+ // Iceberg, Paimon and Hudi table. In the future, if necessary, we will need to filter out
+ // other tables. In addition, the current return also includes tables of type VIRTUAL-VIEW.
+ String icebergAndPaimonFilter = getIcebergAndPaimonFilter();
+ List<String> icebergAndPaimonTables =
+ clientPool.run(
+ c ->
+ c.listTableNamesByFilter(
+ schemaIdent.name(), icebergAndPaimonFilter, (short) -1));
Review Comment:
What's the meaning of `(short) -1` here? Can you define a constant and add a comment on it?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mygrsun (via GitHub)" <gi...@apache.org>.
mygrsun commented on PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#issuecomment-2376297777
> @mygrsun Is there any progress? May I take on this?
thanks,you can do it
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 closed pull request #4469: [#4089] fix(hive catalog): the problem of slow acquisition of hive table list
URL: https://github.com/apache/gravitino/pull/4469
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1711484590
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -557,23 +556,18 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
+ String filter =
+ String.format(
+ "%stable_type = \"ICEBERG\"", hive_metastoreConstants.HIVE_FILTER_FIELD_PARAMS);
Review Comment:
Filtering out only the Iceberg table seems to be insufficient, and we currently also do not support external and view types.
So I think you should use show managed type table when `listAllTables=false`
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mygrsun (via GitHub)" <gi...@apache.org>.
mygrsun commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1721161136
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -557,23 +556,18 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
+ String filter =
+ String.format(
+ "%stable_type = \"ICEBERG\"", hive_metastoreConstants.HIVE_FILTER_FIELD_PARAMS);
Review Comment:
I add some comment ,please review again
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -557,23 +556,18 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
+ String filter =
+ String.format(
+ "%stable_type = \"ICEBERG\"", hive_metastoreConstants.HIVE_FILTER_FIELD_PARAMS);
Review Comment:
I add some comments ,please review again
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "mygrsun (via GitHub)" <gi...@apache.org>.
mygrsun commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1721160942
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -557,23 +556,18 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
+ String filter =
+ String.format(
+ "%stable_type = \"ICEBERG\"", hive_metastoreConstants.HIVE_FILTER_FIELD_PARAMS);
Review Comment:
> If we do not filter the view, what impact will it have on Gravitino?
I have tested it.The view table ,don‘t have any impact ,so i think we can do like this.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#4089] fix(hive catalog): the problem of slow acquisition of hive table list [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4469:
URL: https://github.com/apache/gravitino/pull/4469#discussion_r1827135468
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -539,23 +538,32 @@ public NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaExcep
// then based on
// those names we can obtain metadata for each individual table and get the type we needed.
List<String> allTables = clientPool.run(c -> c.getAllTables(schemaIdent.name()));
- return clientPool.run(
- c ->
- c.getTableObjectsByName(schemaIdent.name(), allTables).stream()
- .filter(
- tb -> {
- boolean isSupportTable = SUPPORT_TABLE_TYPES.contains(tb.getTableType());
- if (!isSupportTable) {
- return false;
- }
- if (!listAllTables) {
- Map<String, String> parameters = tb.getParameters();
- return isHiveTable(parameters);
- }
- return true;
- })
- .map(tb -> NameIdentifier.of(namespace, tb.getTableName()))
- .toArray(NameIdentifier[]::new));
+ if (!listAllTables) {
Review Comment:
@mchades I think you should also check Paimon catalog, AFAIK, we have supported Paimon with HMS backend recently. Please sync with @FANNG1 and @caican00 .
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org