Uh oh!
There was an error while loading. Please reload this page.
Allow loading custom Catalog implementation in Spark and Flink - #1640
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
giovannifumarola
commented
Oct 22, 2020
Thanks Jack. I like the following approach. |
rdblue
commented
Oct 23, 2020
My main concern with this is how configuration is currently passed using Hadoop I think we also want to pass options from the catalog config in Flink and Spark, where users can pass properties like |
rymurr
commented
Oct 27, 2020
I like the Map over Configuration suggestion as well. In #1587 I made the constructor take Has anyone thought of how to do this for the |
rdblue
commented
Oct 27, 2020
@rymurr, for your
Figuring out how we want to do this shouldn't be too difficult. We just found it easier to keep the existing behavior for the last release since there weren't other catalogs at the time. |
jackye1995
commented
Oct 27, 2020
fix rebase issue, reopen PR |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| public static final String ICEBERG_CATALOG_TYPE = "catalog-type"; | ||
| public static final String ICEBERG_CATALOG_TYPE_HADOOP = "hadoop"; | ||
| public static final String ICEBERG_CATALOG_TYPE_HIVE = "hive"; | ||
| public static final String ICEBERG_CATALOG_TYPE_CUSTOM = "custom"; |
There was a problem hiding this comment.
Instead of using type=custom and impl=com.example.Catalog, why not just combine them into type=com.example.Catalog. We can try to load the type as an implementation class if it isn't a well-known name like "hive".
There was a problem hiding this comment.
@aokolnychyi and @RussellSpitzer, do you have an opinion here?
There was a problem hiding this comment.
Yeah this sounds like a cleaner way to go, the only disadvantage is that we are overloading the term type. I have updated the code.
Uh oh!
There was an error while loading. Please reload this page.
rdblue
commented
Nov 3, 2020
@jackye1995, I'm happy with the implementation and behavior (other than changing |
jackye1995
commented
Nov 3, 2020
Interesting, but it should still be compatible by using |
jacques-n
commented
Nov 3, 2020
I was suggesting using the narrower function instead map here as well. |
rdblue
commented
Nov 3, 2020
What's the drawback of using a map? It is a bit narrower to use the function, but it is also limiting. Catalogs can't use |
jacques-n
commented
Nov 3, 2020
Just a lot extra methods exposed. Iteration, put, etc. |
jackye1995
commented
Nov 4, 2020
I think the advantage of using a
|
jackye1995
commented
Nov 4, 2020
@rdblue@jacques-n any thoughts? |
jacques-n
commented
Nov 4, 2020
I'm fine with it as is. Some background: I'm not especially supportive of maps in interfaces since they are so broad. I've had bad experiences in the past where we've had to move maps to external storage (say DynamoDB) and having a broad use of the Map interface hurt us in reworking things. |
rdblue
commented
Nov 4, 2020
I think it is okay to use a map here. Like I said, even if we had to copy values to create a map to pass in here, that happens once per session and is not an unreasonable amount of overhead. |
As we are having multiple new Catalog implementations added to Iceberg, we need a way to load those Catalogs in Spark and Flink easily. Currently there is a simple switch branch that chooses between
hiveandhadoopcatalogs. This approach requires theiceberg-sparkandiceberg-flinkmodule to take a dependency on the catalog implementation modules. This would potentially bring in many unnecessary dependencies as more and more cloud providers try to add support for Iceberg.This PR proposes the following way to load custom Catalog implementations:
typeof a catalog can behiveorhadoopto keep existing behaviorscatalog-implis set,typeis ignored and we will load catalog based on the class valueinitialize()Configurableto read Hadoop configurationFor example, a
GlueCatalogwill be used in Spark like the following: