Skip to content

Conversation

@mxdzs0612
Copy link
Contributor

@mxdzs0612 mxdzs0612 commented Apr 15, 2022

What type of PR is this:

  • bug
  • feature
  • enhancement
  • others

Which issues of this PR fixes :

Fixes #3826

Problem Summary(Required) :

Add support for custom catalog which can be defined by users themselves when creating iceberg external table.

The custom catalog should be in the form of IcebergHiveCatalog, in other words extending BaseMetastoreCatalog and implementing IcebergCatalog. The catalog JAR should be placed into each fe/lib directory, and FE has to be restarted before custom catalog works.

Usage:

CREATE EXTERNAL RESOURCE "iceberg0"
PROPERTIES (
  "type" = "iceberg",
  "starrocks.catalog-type"="CUSTOM",
  "iceberg.catalog-impl"="{The full class name of custom catalog}"
);

Extra config users defined can be added in table properties when executing CREATE EXTERNAL TABLE, see #2225.

@mxdzs0612 mxdzs0612 marked this pull request as ready for review April 19, 2022 12:20
caneGuy
caneGuy previously approved these changes Apr 20, 2022
Copy link
Contributor

@caneGuy caneGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@caneGuy caneGuy changed the title Support custom catalog for iceberg external table. Support custom catalog for iceberg external table Apr 20, 2022
@DorianZheng
Copy link
Contributor

I have left a comment, rest LGTM.

throw new DdlException(ICEBERG_IMPL + " must be set in properties");
}
try {
Thread.currentThread().getContextClassLoader().loadClass(catalogImpl);
Copy link
Contributor

@stephen-shelby stephen-shelby Apr 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just to verify whether the jvm has loaded the custom class when create customer iceberg resource? If fe restarts and the loadClass() method will not be called.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there other considerations here? In fact, there is no need to restart fe by dynamically loading the custom jar.

@mxdzs0612
Copy link
Contributor Author

run starrocks_fe_unittest

caneGuy
caneGuy previously approved these changes Apr 22, 2022
DorianZheng
DorianZheng previously approved these changes Apr 22, 2022
Copy link
Contributor

@DorianZheng DorianZheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left one comment, rest LGTM

@mxdzs0612 mxdzs0612 dismissed stale reviews from DorianZheng and caneGuy via e646148 April 22, 2022 09:41
@wanpengfei-git
Copy link
Collaborator

[FE PR Coverage check]

😞 fail : 26 / 42 (61.90%)

file detail

path covered line new line coverage
🔵 com/starrocks/catalog/IcebergResource.java 5 10 50.00%
🔵 com/starrocks/external/iceberg/IcebergUtil.java 3 5 60.00%
🔵 com/starrocks/catalog/IcebergTable.java 9 14 64.29%
🔵 com/starrocks/external/iceberg/CatalogLoader.java 8 12 66.67%
🔵 com/starrocks/external/iceberg/IcebergCatalogType.java 1 1 100.00%

@imay imay merged commit 9d522b0 into StarRocks:main Apr 24, 2022
@mxdzs0612 mxdzs0612 deleted the iceberg-catalog branch April 24, 2022 03:41
blackstar-baba pushed a commit to blackstar-baba/starrocks that referenced this pull request Apr 28, 2022
Add support for custom catalog which can be defined by users themselves when creating iceberg external table.

The custom catalog should be in the form of IcebergHiveCatalog, in other words extending BaseMetastoreCatalog and implementing IcebergCatalog. The catalog JAR should be placed into each fe/lib directory, and FE has to be restarted before custom catalog works.

Usage:
```sql
CREATE EXTERNAL RESOURCE "iceberg0"
PROPERTIES (
  "type" = "iceberg",
  "starrocks.catalog-type"="CUSTOM",
  "iceberg.catalog-impl"="{The full class name of custom catalog}"
);
```
Extra config users defined can be added in table properties when executing CREATE EXTERNAL TABLE, see StarRocks#2225.
jaogoy pushed a commit to jaogoy/starrocks that referenced this pull request Nov 15, 2023
Signed-off-by: EsoragotoSpirit <wanglichen@starrocks.com>
jaogoy pushed a commit to jaogoy/starrocks that referenced this pull request Nov 15, 2023
Signed-off-by: EsoragotoSpirit <wanglichen@starrocks.com>
(cherry picked from commit 8c46037)

Co-authored-by: 絵空事スピリット <wanglichen@starrocks.com>
jaogoy pushed a commit to jaogoy/starrocks that referenced this pull request Nov 15, 2023
Signed-off-by: EsoragotoSpirit <wanglichen@starrocks.com>
(cherry picked from commit 8c46037)

Co-authored-by: 絵空事スピリット <wanglichen@starrocks.com>
jaogoy pushed a commit to jaogoy/starrocks that referenced this pull request Nov 15, 2023
Signed-off-by: EsoragotoSpirit <wanglichen@starrocks.com>
(cherry picked from commit 8c46037)

Co-authored-by: 絵空事スピリット <wanglichen@starrocks.com>
jaogoy pushed a commit to jaogoy/starrocks that referenced this pull request Nov 15, 2023
Signed-off-by: EsoragotoSpirit <wanglichen@starrocks.com>
(cherry picked from commit 8c46037)

Co-authored-by: 絵空事スピリット <wanglichen@starrocks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Iceberg custom catalog

6 participants