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


##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergCatalogFactory.java:
##########
@@ -455,6 +459,18 @@ public static Map<String, String> 
buildCatalogProperties(IcebergCatalogPropertie
         }
         chosenS3.ifPresent(storage -> 
storage.toBackendProperties().ifPresent(backend -> {
             Optional<GcsAuth> auth = GcsAuthResolver.resolve(backend.toMap());
+            // Keep explicit FileIO choices. The plugin bundles iceberg-gcp, 
so upstream ResolvingFileIO
+            // routes gs to GCSFileIO whenever that class is loadable - 
independently of which GCS
+            // credential mode is configured - and drops the fs.gs.* / 
fs.s3a.* configuration Doris
+            // builds for GCS. Native ADC / COMPUTE_ENGINE bindings always get 
the pin (they emit the
+            // S3FileIO dialect below). HMAC and anonymous bindings get it 
only on REST, the one flavor
+            // whose SDK default is ResolvingFileIO; hms / hadoop / jdbc 
default to HadoopFileIO and glue
+            // to S3FileIO, and HMS emits no S3FileIO options, so the pin 
would send its s3/s3a paths to
+            // an unconfigured S3FileIO.
+            auth.filter(gcsAuth -> gcsAuth.getNativeCredential().isPresent()
+                            || 
IcebergCatalogProperties.TYPE_REST.equals(flavor))
+                    .ifPresent(ignored -> 
opts.putIfAbsent(CatalogProperties.FILE_IO_IMPL,
+                            NativeGcsResolvingFileIO.class.getName()));

Review Comment:
   [P2] Preserve the GCS fallback for catalogs with only Hadoop settings
   
   This default is guarded by `chosenS3`, so a REST catalog with an 
opaque/server-selected warehouse and only `fs.gs.impl` plus 
`fs.gs.auth.type=SERVICE_ACCOUNT_JSON_KEYFILE`/`fs.gs.auth.service.account.json.keyfile`
 never gets it: `GcsAuthResolver.guessIsGcs()` does not recognize raw `fs.*`, 
and the storage binder falls back to HDFS. `buildHadoopConfiguration()` 
explicitly supports these keys, and previously `ResolvingFileIO` fell back to 
`HadoopFileIO` because `iceberg-gcp` was absent. With that jar now bundled, it 
loads `GCSFileIO`, ignores the configured keyfile and uses ADC, so existing 
`gs://` metadata/manifest reads fail on a host without matching ADC. Apply the 
REST routing default independently of typed-storage inference while preserving 
explicit `io-impl`, and cover the empty-`chosenS3` case. This affects FE 
metadata access in existing catalogs, separately from the earlier BE credential 
and packaging threads.



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