Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ARCTIC-260][Core]Support loading Iceberg catalog #549

Merged
merged 4 commits into from
Nov 1, 2022
Merged

[ARCTIC-260][Core]Support loading Iceberg catalog #549

merged 4 commits into from
Nov 1, 2022

Conversation

zhoujinsong
Copy link
Contributor

@zhoujinsong zhoujinsong commented Nov 1, 2022

Why are the changes needed?

Subtask of #260.
Support loading iceberg catalog.

Brief change log

  • Add BaseIcebergCatalog implementation of ArcticCatalog for native iceberg usage
  • CatalogLoader support loading BaseIcebergCatalog
  • Add authrozation for BaseIcebergCatalog

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before making a pull request

Documentation

  • Does this pull request introduces a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

String catalogImpl;
Set<TableFormat> tableFormats = CatalogUtil.tableFormats(catalogMeta);
Preconditions.checkArgument(tableFormats.size() == 1, "Catalog support only one table format now.");
TableFormat tableFormat = tableFormats.iterator().next();
switch (type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这边在实现上,是不是不要在代码层面复用 type 字段了。 v0.4 就直接引入 metastore, table-format 两个新字段。 v0.3 的还走 type 逻辑。 这样代码上更清晰一些。
在兼容性上,保证 v0.4 接口还有 type 字段,v0.5 开始就不返回 type 字段了?

Copy link
Contributor Author

@zhoujinsong zhoujinsong Nov 1, 2022

Choose a reason for hiding this comment

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

catalog type is the same with metastore in AMS Dashboard.
I prefer to not add a metastore property in database and thrift argument.

@zhoujinsong zhoujinsong merged commit fb0affc into apache:master Nov 1, 2022
return tableMetaStore.doAs(() -> ((SupportsNamespaces)icebergCatalog).listNamespaces(Namespace.empty()).stream()
.map(namespace -> namespace.level(0)).distinct().collect(Collectors.toList()));
} else {
throw new UnsupportedOperationException(String.format("Iceberg catalog: %s do now implement SupportsNamespaces",
Copy link
Contributor

Choose a reason for hiding this comment

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

throw new UnsupportedOperationException(String.format("Iceberg catalog: %s do now implement SupportsNamespaces",

'do now' should be does not ?

return null;
});
} else {
throw new UnsupportedOperationException(String.format("Iceberg catalog: %s do now implement SupportsNamespaces",
Copy link
Contributor

Choose a reason for hiding this comment

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

do now --> does not

return null;
});
} else {
throw new UnsupportedOperationException(String.format("Iceberg catalog: %s do now implement SupportsNamespaces",
Copy link
Contributor

Choose a reason for hiding this comment

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

throw new UnsupportedOperationException(String.format("Iceberg catalog: %s do now implement SupportsNamespaces",

'do now' should be does not ?

wangtaohz pushed a commit to wangtaohz/amoro that referenced this pull request Nov 7, 2022
* add BaseIcebergCatalog

* fix compile errors

* fix style errors

* fix comments
@zhoujinsong zhoujinsong deleted the iceberg-native-catalog branch November 28, 2022 08:58
zhoujinsong added a commit that referenced this pull request May 31, 2023
* add BaseIcebergCatalog

* fix compile errors

* fix style errors

* fix comments
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.

4 participants