aokolnychyi commented on code in PR #6651:
URL: https://github.com/apache/iceberg/pull/6651#discussion_r1105335863
##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/SparkUtil.java:
##########
@@ -295,4 +297,20 @@ public static List<Expression> partitionMapToExpression(
public static String toColumnName(NamedReference ref) {
return DOT.join(ref.fieldNames());
}
+
+ /**
+ * fetch latest snapshot based on the branch tip. We are still using
currentSnapshot() when commit
+ * is to main branch to validate behavior has not changed.
+ *
+ * @param table to fetch snapshot from.
+ * @param branch used to fetch snapshot from a branch ref.
+ * @return Snapshot
+ */
+ public static Snapshot latestSnapshot(Table table, String branch) {
Review Comment:
Is this the right place for this? Seems really independent of Spark. What
about using `SnapshotUtil`?
##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/SparkUtil.java:
##########
@@ -295,4 +297,20 @@ public static List<Expression> partitionMapToExpression(
public static String toColumnName(NamedReference ref) {
return DOT.join(ref.fieldNames());
}
+
+ /**
+ * fetch latest snapshot based on the branch tip. We are still using
currentSnapshot() when commit
+ * is to main branch to validate behavior has not changed.
+ *
+ * @param table to fetch snapshot from.
+ * @param branch used to fetch snapshot from a branch ref.
+ * @return Snapshot
+ */
+ public static Snapshot latestSnapshot(Table table, String branch) {
Review Comment:
Is this the right place for this? Seems independent of Spark. What about
using `SnapshotUtil`?
--
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]