WweiL commented on code in PR #48355:
URL: https://github.com/apache/spark/pull/48355#discussion_r1858314943
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDBFileManager.scala:
##########
@@ -322,14 +349,18 @@ class RocksDBFileManager(
val path = new Path(dfsRootDir)
if (fm.exists(path)) {
val files = fm.list(path).map(_.getPath)
- val changelogFileVersions = files
- .filter(onlyChangelogFiles.accept)
- .map(_.getName.stripSuffix(".changelog"))
- .map(_.toLong)
- val snapshotFileVersions = files
- .filter(onlyZipFiles.accept)
- .map(_.getName.stripSuffix(".zip"))
- .map(_.toLong)
+ val changelogFileVersions = files.filter(onlyChangelogFiles.accept)
+ .map(_.getName.stripSuffix(".changelog").split("_"))
+ .map {
+ case Array(version, _) => version.toLong
+ case Array(version) => version.toLong
+ }
+ val snapshotFileVersions = files.filter(onlyZipFiles.accept)
+ .map(_.getName.stripSuffix(".zip").split("_"))
+ .map {
+ case Array(version, _) => version.toLong
+ case Array(version) => version.toLong
+ }
Review Comment:
The "list" operation is the same as before. I don't think the map function
is expensive
--
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]