-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add support for Nessie Catalog in Iceberg Connector #17719
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
| import com.facebook.presto.hive.HiveCompressionCodec; | ||
| import com.facebook.presto.hive.OrcFileWriterConfig; | ||
| import com.facebook.presto.hive.ParquetFileWriterConfig; | ||
| import com.facebook.presto.iceberg.nessie.NessieConfig; | ||
| import com.facebook.presto.orc.OrcWriteValidation; | ||
| import com.facebook.presto.spi.ConnectorSession; | ||
| import com.facebook.presto.spi.PrestoException; | ||
|
|
@@ -71,6 +72,8 @@ public final class IcebergSessionProperties | |
| private static final String ORC_COMPRESSION_CODEC = "orc_compression_codec"; | ||
| private static final String CACHE_ENABLED = "cache_enabled"; | ||
| private static final String NODE_SELECTION_STRATEGY = "node_selection_strategy"; | ||
| private static final String NESSIE_REFERENCE_NAME = "nessie_reference_name"; | ||
| private static final String NESSIE_REFERENCE_HASH = "nessie_reference_hash"; | ||
| private final List<PropertyMetadata<?>> sessionProperties; | ||
|
|
||
| @Inject | ||
|
|
@@ -79,7 +82,8 @@ public IcebergSessionProperties( | |
| HiveClientConfig hiveClientConfig, | ||
| ParquetFileWriterConfig parquetFileWriterConfig, | ||
| OrcFileWriterConfig orcFileWriterConfig, | ||
| CacheConfig cacheConfig) | ||
| CacheConfig cacheConfig, | ||
| NessieConfig nessieConfig) | ||
| { | ||
| sessionProperties = ImmutableList.of( | ||
| new PropertyMetadata<>( | ||
|
|
@@ -240,6 +244,16 @@ public IcebergSessionProperties( | |
| CACHE_ENABLED, | ||
| "Enable cache for Iceberg", | ||
| cacheConfig.isCachingEnabled(), | ||
| false), | ||
| stringProperty( | ||
| NESSIE_REFERENCE_NAME, | ||
| "Nessie reference name to use", | ||
| nessieConfig.getDefaultReferenceName(), | ||
| false), | ||
| stringProperty( | ||
| NESSIE_REFERENCE_HASH, | ||
| "Nessie reference hash to use", | ||
|
||
| null, | ||
| false)); | ||
| } | ||
|
|
||
|
|
@@ -387,4 +401,14 @@ public static NodeSelectionStrategy getNodeSelectionStrategy(ConnectorSession se | |
| { | ||
| return session.getProperty(NODE_SELECTION_STRATEGY, NodeSelectionStrategy.class); | ||
| } | ||
|
|
||
| public static String getNessieReferenceName(ConnectorSession session) | ||
| { | ||
| return session.getProperty(NESSIE_REFERENCE_NAME, String.class); | ||
| } | ||
|
|
||
| public static String getNessieReferenceHash(ConnectorSession session) | ||
| { | ||
| return session.getProperty(NESSIE_REFERENCE_HASH, String.class); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: to be more consistent, we could put all the cases in alphabetical order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's what I had initially, but Intellij would then complain due to duplicate case branches. So I figured that it's better to merge
HADOOP+NESSIEtogetherThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@beinan let me know if you would like me to still change this and introduce duplicate case branches