marton-bod commented on a change in pull request #3752:
URL: https://github.com/apache/iceberg/pull/3752#discussion_r772521518



##########
File path: core/src/main/java/org/apache/iceberg/SerializableTable.java
##########
@@ -386,4 +393,21 @@ public Configuration get() {
       return conf;
     }
   }
+
+  private static class SkipSerializableConfiguration implements Serializable {
+
+    private transient volatile Configuration conf;
+
+    SkipSerializableConfiguration(Configuration conf) {
+      this.conf = conf;
+    }
+
+    public Configuration get() {
+      if (conf == null) {
+        throw new IllegalStateException("Configuration was not serialized on 
purpose but was not set manually either");

Review comment:
       `new Configuration()` would create an empty config object in Hive, 
without reading all the hive-site.xml values (unlike `new HiveConf()`). Using 
this empty configuration could then lead to file IO failures or unexpected 
behaviour. Deciding not to serialize the FileIO config must be followed up by 
setting the missing config explicitly on the deserializer-side. I would rather 
throw an exception and catch clients who have failed to do so (and fix those 
instances), than proceed with creating an empty conf which can then lead to 
issues.




-- 
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]

Reply via email to