yihua opened a new issue, #870:
URL: https://github.com/apache/hudi-rs/issues/870

   ### Feature Description
   
   The native write path accepts only a single `Utf8` record key field: 
`Table::create(...).with_record_key_fields(["order_id", "item_id"])` followed 
by `append` fails with `writes currently require exactly one record key field`, 
and a single integer key fails with `record key field 'id' must be Utf8 for 
writes`. Tables written by Spark with composite or integer keys are common, so 
hudi-rs cannot write to them.
   
   Proposed: build record keys the way Java's `KeyGenerator.constructRecordKey` 
does (`field1:value1,field2:value2`, with `__null__` and `__empty__` 
placeholders and the same all-null error), for string, boolean, integer, date 
and decimal key fields, and share that encoding between the writer, 
`SimpleIndex`, and the virtual-key reader so all three agree. Timestamp and 
floating-point key fields stay unsupported, since Spark's Avro path, Spark's 
row writer, Flink, and the writer's JDK store them differently and a mismatch 
would duplicate rows.
   
   ### Additional context
   
   Delete by a filter on one field of a composite key has to scan rather than 
use the record index, since that field alone is not a key.
   


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