github-actions[bot] commented on code in PR #70980:
URL: https://github.com/apache/doris/pull/70980#discussion_r4691625184


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AbstractIcebergProperties.java:
##########
@@ -148,13 +172,27 @@ public final Catalog initializeCatalog(String catalogName,
                                            List<StorageProperties> 
storagePropertiesList,
                                            SessionContext sessionContext) {
         Map<String, String> catalogProps = new HashMap<>(getOrigProps());
+        // Replayed and directly initialized catalogs must be checked before 
the SDK can authenticate.
+        IcebergGoogleCredentialValidator.validate(catalogProps);
         if (StringUtils.isNotBlank(warehouse)) {
             catalogProps.put(CatalogProperties.WAREHOUSE_LOCATION, warehouse);
         }
 
         // Add manifest cache properties if configured
         addManifestCacheProperties(catalogProps);
 
+        if 
(!IcebergExternalCatalog.ICEBERG_REST.equals(getIcebergCatalogType())
+                && 
ResolvingFileIO.class.getName().equals(catalogProps.get(CatalogProperties.FILE_IO_IMPL)))
 {
+            Configuration conf = new Configuration();
+            for (StorageProperties storage : 
IcebergUtils.selectEffectiveStorageProperties(storagePropertiesList)) {
+                if (storage.getHadoopStorageConfig() != null) {
+                    conf.addResource(storage.getHadoopStorageConfig());
+                }
+            }
+            // Some catalog factories bypass toFileIOProperties but still 
honor an explicit generic resolver.
+            preserveHadoopGcsFileIO(storagePropertiesList, catalogProps, conf);

Review Comment:
   [P2] Pass the effective Hadoop configuration to Glue's FileIO
   
   For a Glue catalog with an explicit `org.apache.iceberg.io.ResolvingFileIO`, 
`gs.endpoint=https://storage.googleapis.com`, separate `glue.*` credentials and 
service-account ADC from `GOOGLE_APPLICATION_CREDENTIALS` on a non-GCE FE, this 
block replaces the working SDK GCS reader with `NativeGcsResolvingFileIO`. The 
temporary configuration contains `fs.gs.auth.type=APPLICATION_DEFAULT`, but it 
is discarded here: `IcebergGlueMetaStoreProperties.initCatalog` still calls 
`buildIcebergCatalog(..., null)`. Consequently the selected HadoopFileIO 
creates a default configuration, and without a global auth override the 
installed GCS connector selects [COMPUTE_ENGINE 
credentials](https://github.com/GoogleCloudDataproc/hadoop-connectors/blob/v3.1.18/util-hadoop/src/main/java/com/google/cloud/hadoop/util/HadoopCredentialsConfiguration.java#L73-L75),
 rather than the ADC file. Metadata reads that worked before now fail trying to 
obtain VM credentials. Pass the same effective configuration through
  the actual Glue factory/FileIO initialization before replacing its resolver; 
the added mock-factory test only checks the class name and misses this loss of 
credentials. This is distinct from the existing REST bearer-token thread, whose 
explicit selector is preserved on this head.



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