andygrove opened a new issue, #6140:
URL: https://github.com/apache/datafusion-comet/issues/6140

   ### Describe the bug
   
   The native Iceberg write gate and the native storage factory read the scheme 
of a data location differently, so some locations pass the gate and then fail 
at execution.
   
   - The gate (`CometIcebergNativeWrite.storageScheme`, 
`CometIcebergNativeWrite.scala:310-315`) takes the text before `://`, and 
treats a location without `://` as `file`.
   - The native side (`scheme_of`, `iceberg_common.rs:229`) takes the text 
before the first `:`.
   
   Hadoop normalises `hdfs:///warehouse/t` to `hdfs:/warehouse/t`. For that 
location the gate sees no `://`, calls it `file` and admits it. The native 
writer reads `hdfs`, which has no storage backend, and every task fails with 
`Unsupported storage scheme: hdfs`. The query fails instead of falling back to 
iceberg-java. The same applies to any `scheme:/path` form.
   
   ### Steps to reproduce
   
   Create an Iceberg table whose data location is written `hdfs:/path` (for 
example through `LOCATION 'hdfs:/...'`, or a Hadoop catalog whose warehouse was 
normalised), enable `spark.comet.iceberg.write.enabled`, and insert into it.
   
   ### Expected behavior
   
   The write falls back to iceberg-java with an `unsupported storage scheme: 
hdfs` reason. The gate should use the same scheme rule as `scheme_of`, ideally 
one shared implementation.
   
   ### Additional context
   
   #6065 (closes #5541) moves the supported-scheme lists to the native factory 
and touches `storageScheme`, but it keeps the `://` split, so it does not fix 
this. It would be a natural place to align the parsing too.
   
   Found in an audit of the native Iceberg write path before enabling it by 
default. Part of #5649.
   


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