vinothchandar commented on PR #666:
URL: https://github.com/apache/hudi-rs/pull/666#issuecomment-5321570394

   **For reviewers: what the API looks like**
   
   The full runnable tour is in 
[`crates/core/examples/table_writes.rs`](https://github.com/vinothchandar/hudi-rs/blob/feat/table-writes/crates/core/examples/table_writes.rs)
 — `cargo run -p hudi-core --example table_writes`. The short version:
   
   ```rust
   // Create — config lives on the builder; MDT + record-level index on by 
default.
   let mut table = Table::create("/tmp/trips")
       .with_table_name("trips")
       .with_table_type(TableTypeValue::CopyOnWrite)   // or MergeOnRead
       .with_record_key_fields(["id"])                 // omit → auto-generated 
keys
       .with_partition_fields(["city"])                // hive-style paths
       .with_ordering_fields(["ts"])                   // event-time; omit → 
commit-time
       .create()
       .await?;
   
   // All verbs take Arrow RecordBatches.
   table.append([batch]).await?;                        // insert-only fast path
   table.upsert([batch]).await?;                        // keyed upsert via the 
record-level index
   table.update("city = 'nyc'", set_fare).await?;       // SET columns on rows 
matching a filter
   table.delete("fare > 100").await?;                   // key predicates → 
index; others → scoped scan
   table.overwrite([batch]).await?;                     // 
INSERT_OVERWRITE_TABLE
   table.dynamic_partition_overwrite([batch]).await?;   // INSERT_OVERWRITE 
(partitions in input)
   
   // Reads work against the same handle: snapshot, time-travel, incremental.
   let rows = table.read(&ReadOptions::new()).await?;
   let changes = table
       .read(&ReadOptions::new().with_query_type(QueryType::Incremental))
       .await?;
   ```
   
   Everything is `Table`-owned and path-based (no catalog); unsupported 
combinations (e.g. partial upsert on MOR, custom payload classes) return typed 
`Unsupported` errors rather than writing something Spark can't read.
   


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