rajarshisarkar commented on code in PR #4489:
URL: https://github.com/apache/iceberg/pull/4489#discussion_r842375076
##########
build.gradle:
##########
@@ -612,6 +612,12 @@ project(':iceberg-dell') {
testImplementation "javax.xml.bind:jaxb-api"
testImplementation "javax.activation:activation"
testImplementation "org.glassfish.jaxb:jaxb-runtime"
+ testImplementation("org.apache.hadoop:hadoop-common") {
+ exclude group: 'org.apache.avro', module: 'avro'
+ exclude group: 'org.slf4j', module: 'slf4j-log4j12'
+ exclude group: 'javax.servlet', module: 'servlet-api'
+ exclude group: 'com.google.code.gson', module: 'gson'
+ }
Review Comment:
`TestEcsCatalog` seems to [initialise a FileIO
instance](https://github.com/apache/iceberg/blob/master/dell/src/test/java/org/apache/iceberg/dell/ecs/TestEcsCatalog.java#L62)
thereby causing the following exception without the change:
```
org/apache/hadoop/fs/FileSystem
java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FileSystem
at
org.apache.iceberg.hadoop.HadoopMetricsContext.initialize(HadoopMetricsContext.java:50)
at org.apache.iceberg.dell.ecs.EcsFileIO.initialize(EcsFileIO.java:92)
at
org.apache.iceberg.dell.ecs.EcsCatalog.initializeFileIO(EcsCatalog.java:131)
at
org.apache.iceberg.dell.ecs.EcsCatalog.initialize(EcsCatalog.java:108)
at
org.apache.iceberg.dell.ecs.TestEcsCatalog.before(TestEcsCatalog.java:62)
```
This was because `NoClassDefFoundError` was not handled in the catch block
due to which metrics was not falling back to null metrics in case the exception
happens while doing `metrics.initialize(properties)`. Reference:
https://github.com/apache/iceberg/blob/dfdeb149843ce54e4f7fdd7cc5508477bb6baff6/dell/src/main/java/org/apache/iceberg/dell/ecs/EcsFileIO.java#L86-L95
I think the fallback should be handled in other FileIO's as well. Do let me
know your thoughts on this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]