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

   ### Describe the bug
   
   With `spark.sql.parquet.binaryAsString=false`, reading an unannotated 
Parquet `FIXED_LEN_BYTE_ARRAY(3)` column through an explicit Spark `STRING` 
schema fails in both readers. Spark's vectorized reader reports 
`FAILED_READ_FILE.PARQUET_COLUMN_DATA_TYPE_MISMATCH` (SQLSTATE `KD001`) with a 
`SchemaColumnConvertNotSupportedException` cause. The Comet native scan raises 
`CometNativeException: Unsupported Parquet type conversion from 
FixedSizeBinary(3) to Utf8`.
   
   ### Steps to reproduce
   
   1. Write a Parquet file with schema `message root { optional 
fixed_len_byte_array(3) value; }` and one row containing the bytes of `one`. 
The [fixed-length binary test 
fixture](https://github.com/apache/datafusion-comet/blob/3ab565e45dfc3d1cdefee236ce855503e1e175fa/spark/src/test/scala/org/apache/comet/parquet/ParquetReadSuite.scala#L362-L371)
 creates this file.
   2. In a Spark session with Comet installed, run the following once per 
reader, setting `spark.comet.enabled` to `false` for Spark and `true` for 
Comet. Create the DataFrame after setting the configuration each time.
   
   ```scala
   spark.conf.set("spark.sql.parquet.enableVectorizedReader", "true")
   spark.conf.set("spark.sql.parquet.binaryAsString", "false")
   spark.read.schema("value STRING").parquet(path).collect()
   ```
   
   ### Expected behavior
   
   The native Spark Parquet scan should raise the same structured conversion 
error as Spark for this explicit schema. Cover the setting-off case with a 
Spark/Comet regression test and preserve Iceberg UUID reads, which share the 
schema adapter.
   
   ### Additional context
   
   Reproduced with Spark 4.1.3 at Comet commit `3ab565e45`. The physical plan 
used `CometNativeScanExec` with Comet enabled. PR #6246 handles this conversion 
with `binaryAsString=true`. [Review 
discussion](https://github.com/apache/datafusion-comet/pull/6246#pullrequestreview-6104042115).
   


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