You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "Zouxxyy (via GitHub)" <gi...@apache.org> on 2025/11/17 12:49:26 UTC

[PR] [spark] Make latestSnapshot and currentSnapshot val in Scan [paimon]

Zouxxyy opened a new pull request, #6621:
URL: https://github.com/apache/paimon/pull/6621

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   
   <!-- Linking this pull request to the issue -->
   Linked issue: close #xxx
   
   <!-- What is the purpose of the change -->
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core][spark] Introduce lastScannedSnapshotId in ScanMetrics [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #6621:
URL: https://github.com/apache/paimon/pull/6621


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core][spark] Introduce lastScannedSnapshotId in ScanMetrics [paimon]

Posted by "Zouxxyy (via GitHub)" <gi...@apache.org>.
Zouxxyy commented on code in PR #6621:
URL: https://github.com/apache/paimon/pull/6621#discussion_r2534400042


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonBaseScan.scala:
##########
@@ -141,37 +160,14 @@ abstract class PaimonBaseScan(
       ""
     }
 
-    val latestSnapshotId = if (table.latestSnapshot().isPresent) {
-      Some(table.latestSnapshot().get.id)
-    } else {
-      None
-    }
-
-    val latestSnapshotIdStr = if (latestSnapshotId.isDefined) {
-      s", LatestSnapshotId: [${latestSnapshotId.get}]"
+    val latestSnapshotIdStr = if (latestSnapshot.nonEmpty) {

Review Comment:
   It's not very useful, it will increase request, I'm inclined to remove it.



##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonBaseScan.scala:
##########
@@ -141,37 +160,14 @@ abstract class PaimonBaseScan(
       ""
     }
 
-    val latestSnapshotId = if (table.latestSnapshot().isPresent) {
-      Some(table.latestSnapshot().get.id)
-    } else {
-      None
-    }
-
-    val latestSnapshotIdStr = if (latestSnapshotId.isDefined) {
-      s", LatestSnapshotId: [${latestSnapshotId.get}]"
+    val latestSnapshotIdStr = if (latestSnapshot.nonEmpty) {

Review Comment:
   It's not very useful and will increase request, I'm inclined to remove it.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [spark] Make latestSnapshot and currentSnapshot val in Scan [paimon]

Posted by "Zouxxyy (via GitHub)" <gi...@apache.org>.
Zouxxyy commented on code in PR #6621:
URL: https://github.com/apache/paimon/pull/6621#discussion_r2534221782


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonBaseScan.scala:
##########
@@ -56,6 +57,24 @@ abstract class PaimonBaseScan(
 
   override val coreOptions: CoreOptions = CoreOptions.fromMap(table.options())
 
+  val latestSnapshot: Option[Snapshot] = table.latestSnapshot()
+
+  val currentSnapshot: Option[Snapshot] =

Review Comment:
   Great, I will add `lastScannedSnapshotId` in `ScanMetrics`



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [spark] Make latestSnapshot and currentSnapshot val in Scan [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #6621:
URL: https://github.com/apache/paimon/pull/6621#discussion_r2534125579


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonBaseScan.scala:
##########
@@ -141,37 +160,14 @@ abstract class PaimonBaseScan(
       ""
     }
 
-    val latestSnapshotId = if (table.latestSnapshot().isPresent) {
-      Some(table.latestSnapshot().get.id)
-    } else {
-      None
-    }
-
-    val latestSnapshotIdStr = if (latestSnapshotId.isDefined) {
-      s", LatestSnapshotId: [${latestSnapshotId.get}]"
+    val latestSnapshotIdStr = if (latestSnapshot.nonEmpty) {

Review Comment:
   Why we need to get latest snapshot? Why not just remove it.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [spark] Make latestSnapshot and currentSnapshot val in Scan [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #6621:
URL: https://github.com/apache/paimon/pull/6621#discussion_r2534124064


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonBaseScan.scala:
##########
@@ -56,6 +57,24 @@ abstract class PaimonBaseScan(
 
   override val coreOptions: CoreOptions = CoreOptions.fromMap(table.options())
 
+  val latestSnapshot: Option[Snapshot] = table.latestSnapshot()
+
+  val currentSnapshot: Option[Snapshot] =

Review Comment:
   Maybe you can get current snapshot from `getOriginSplits`.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [spark] Make latestSnapshot and currentSnapshot val in Scan [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #6621:
URL: https://github.com/apache/paimon/pull/6621#discussion_r2534125579


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonBaseScan.scala:
##########
@@ -141,37 +160,14 @@ abstract class PaimonBaseScan(
       ""
     }
 
-    val latestSnapshotId = if (table.latestSnapshot().isPresent) {
-      Some(table.latestSnapshot().get.id)
-    } else {
-      None
-    }
-
-    val latestSnapshotIdStr = if (latestSnapshotId.isDefined) {
-      s", LatestSnapshotId: [${latestSnapshotId.get}]"
+    val latestSnapshotIdStr = if (latestSnapshot.nonEmpty) {

Review Comment:
   Why we need to get latest snapshot? 



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core][spark] Introduce lastScannedSnapshotId in ScanMetrics [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #6621:
URL: https://github.com/apache/paimon/pull/6621#discussion_r2534420397


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonBaseScan.scala:
##########
@@ -56,6 +57,24 @@ abstract class PaimonBaseScan(
 
   override val coreOptions: CoreOptions = CoreOptions.fromMap(table.options())
 
+  val latestSnapshot: Option[Snapshot] = table.latestSnapshot()
+
+  val currentSnapshot: Option[Snapshot] =

Review Comment:
   Oh nice, let metric come from metric.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org