tokoko commented on code in PR #3523:
URL: https://github.com/apache/datafusion-comet/pull/3523#discussion_r2813866558


##########
spark/src/main/scala/org/apache/comet/iceberg/IcebergReflection.scala:
##########
@@ -237,6 +237,38 @@ object IcebergReflection extends Logging {
     }
   }
 
+  /**
+   * Gets storage properties from an Iceberg table's FileIO.
+   *
+   * This extracts credentials from the FileIO implementation, which is 
critical for REST catalog
+   * credential vending. The REST catalog returns temporary S3 credentials 
per-table via the
+   * loadTable response, stored in the table's FileIO (typically 
ResolvingFileIO).
+   *
+   * The properties() method is not on the FileIO interface -- it exists on 
specific
+   * implementations like ResolvingFileIO and S3FileIO. Returns None 
gracefully when unavailable.
+   */
+  def getFileIOProperties(table: Any): Option[Map[String, String]] = {
+    import scala.jdk.CollectionConverters._
+    getFileIO(table).flatMap { fileIO =>
+      findMethodInHierarchy(fileIO.getClass, "properties").flatMap { 
propsMethod =>
+        try {

Review Comment:
   done, thanks



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