hudi-agent commented on code in PR #19882:
URL: https://github.com/apache/hudi/pull/19882#discussion_r3996128755
##########
hudi-trino/src/main/java/io/trino/plugin/hudi/storage/HudiTrinoStorage.java:
##########
@@ -54,6 +54,25 @@ public HudiTrinoStorage(TrinoFileSystem fileSystem,
TrinoStorageConfiguration st
this.fileSystem = fileSystem;
}
+ public HudiTrinoStorage(StoragePath path, StorageConfiguration<?>
storageConf)
+ {
+ this(trinoConfigurationOf(storageConf, path), path);
+ }
+
+ private HudiTrinoStorage(TrinoStorageConfiguration storageConf,
StoragePath path)
+ {
+ this(storageConf.getFileSystem().orElseThrow(() -> new
IllegalArgumentException(
+ "Storage configuration for " + path + " carries no file
system")), storageConf);
+ }
+
+ private static TrinoStorageConfiguration
trinoConfigurationOf(StorageConfiguration<?> storageConf, StoragePath path)
Review Comment:
🤖 nit: `trinoConfigurationOf` doesn't actually build anything, it just
validates/casts the given config. A name like
`requireTrinoStorageConfiguration` or `castOrThrow` would better reflect that
it's a validation helper, not a factory.
<sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]