LuciferYang opened a new issue, #10743:
URL: https://github.com/apache/paimon/issues/10743

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   ### Paimon version
   
   master (36e2c902e3)
   
   ### Compute Engine
   
   Spark 3.2 to 4.1
   
   ### Minimal reproduce step
   
   ```sql
   SET spark.paimon.format-table.implementation = engine;
   CREATE TABLE t (id INT, data STRING) USING csv
   TBLPROPERTIES ('csv.field-delimiter' = ';', 'file.compression' = 'gzip');
   INSERT INTO t VALUES (1, 'x,y');
   SELECT * FROM t;
   ```
   
   ### What doesn't meet your expectations?
   
   The file is written as `1,"x,y"` and uncompressed, and the SELECT returns 
`[null, null]`. TEXT tables with `file.compression` are written uncompressed as 
well.
   
   Spark's `FallBackFileSourceV2` turns an `INSERT INTO` a `FileTable` into a 
V1 write with the options of the statement only, so the format options of the 
table never reach the writer. Reads go through the table's scan builder, which 
does use them, so reads and writes disagree. The default `paimon` 
implementation is not affected.
   
   Two smaller problems in `FormatTableCatalog`: the TEXT branch copies the 
options before it sets `compression`, and `file.compression = 'zstd'` is passed 
to Spark as `zstd`, which Spark does not know as a short codec name, so reading 
a CSV table with it fails with `Codec [zstd] is not available`.
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!
   


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

Reply via email to