Skip to content

Conversation

@omarsmak
Copy link
Member

This is related to #3162 where if the user tries to set both, catalog-impl and catalog-type, it will fail with an exception.
We have this behavior already in Spark and Hive integrations due to #3162. This PR brings the same behavior to Flink integration as well.

cc: @rdblue @nastra

if (catalogImpl != null) {
String catalogType = properties.get(ICEBERG_CATALOG_TYPE);
Preconditions.checkArgument(catalogType == null,
"Cannot create catalog %s, both catalog-type and catalog-impl are set: catalog-type=%s, catalog-impl=%s",
Copy link
Contributor

Choose a reason for hiding this comment

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

catalog-type isn't a property right? Shouldn't this by type=%s instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevermind, looks like Flink sets this differently.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have recommendations on which values to set that we can provide?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do we have recommendations on which values to set that we can provide?

You mean only hive or hadoop? 🤔

if (catalogImpl != null) {
String catalogType = properties.get(ICEBERG_CATALOG_TYPE);
Preconditions.checkArgument(catalogType == null,
"Cannot create catalog %s, both catalog-type and catalog-impl are set: catalog-type=%s, catalog-impl=%s",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have recommendations on which values to set that we can provide?

@omarsmak omarsmak force-pushed the flink-throw-exception branch from 5b913ea to 2e9cc9c Compare October 19, 2021 09:52
@omarsmak
Copy link
Member Author

@rdblue @kbendick I have tried to change the exception message (Unknown catalog) to have it more meaningful. As well, I have modified the docs a bit to reflect the proper behaviour.

Copy link
Contributor

@rdblue rdblue left a comment

Choose a reason for hiding this comment

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

Mostly looks good. I'll merge after a few updates to docs and error messages. Thanks @omarsmak!

@omarsmak omarsmak force-pushed the flink-throw-exception branch from 2e9cc9c to 6024d55 Compare October 19, 2021 16:29
@omarsmak
Copy link
Member Author

@rdblue @nastra I have addressed your comments in regards to docs, error message rewording and using Assertions

@rdblue rdblue merged commit d72851e into apache:master Oct 19, 2021
@rdblue
Copy link
Contributor

rdblue commented Oct 19, 2021

Thanks, @omarsmak!

@omarsmak omarsmak deleted the flink-throw-exception branch October 20, 2021 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants