dttung2905 opened a new pull request, #548:
URL: https://github.com/apache/iceberg-go/pull/548

   Hi team,
   This PR aim to create a time travel functionality for go sdk. I took 
reference from iceberg-go 
[implementation](https://github.com/apache/iceberg-python/blob/a33cd3835136db5939e8eda9ee14a17d51ab141d/pyiceberg/table/__init__.py#L1230-L1240)
   ## Example for `TimeTravelScan()`
   
   ```go
   // Scan data as it existed 1 day ago
   oneDayAgo := time.Now().Add(-24 * time.Hour).UnixMilli()
   
   // Basic time travel scan
   scan, err := table.TimeTravelScan(oneDayAgo)
   if err != nil {
       log.Fatal("Time travel scan failed:", err)
   }
   
   // Time travel scan with filters and options
   scanWithOptions, err := table.TimeTravelScan(oneDayAgo,
       table.WithSelectedFields("id", "name", "amount"),  // Select specific 
fields
       table.WithRowFilter("amount > 10"), 
       table.WithLimit(10),
   )
   
   // Execute the scan
   batches, err := scan.ToArrowBatches(context.Background())
   if err != nil {
       log.Fatal("Failed to execute scan:", err)
   }
   ```
   
   ## Example for `TimeTravel()`
   
   ```go
   twoHoursAgo := time.Now().Add(10 * time.Hour).UnixMilli()
   snapshot := table.TimeTravel(twoHoursAgo, true)
   fmt.Println(snapshot.SnapshotID)
   ```
   


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