@@ -182,11 +182,7 @@ public CommitRange getTableChanges(Engine engine, long startVersion, Optional<Lo
182182 endVersion .ifPresent (v -> checkArgument (v >= 0 , "endVersion must be non-negative" ));
183183
184184 return loadCommitRangeInternal (
185- engine ,
186- Optional .of (startVersion ),
187- Optional .empty (),
188- endVersion ,
189- Optional .empty ());
185+ engine , Optional .of (startVersion ), Optional .empty (), endVersion , Optional .empty ());
190186 }
191187
192188 /**
@@ -210,8 +206,8 @@ public void close() {
210206 /**
211207 * Internal method to load a snapshot at a specific version or timestamp.
212208 *
213- * <p>This method fetches commits from the catalog adapter, converts them to Kernel's ParsedLogData
214- * format, and uses TableManager to build the snapshot.
209+ * <p>This method fetches commits from the catalog adapter, converts them to Kernel's
210+ * ParsedLogData format, and uses TableManager to build the snapshot.
215211 */
216212 private Snapshot loadSnapshotInternal (Optional <Long > versionOpt , Optional <Long > timestampOpt ) {
217213 checkArgument (
@@ -243,17 +239,21 @@ private Snapshot loadSnapshotInternal(Optional<Long> versionOpt, Optional<Long>
243239 if (timestampOpt .isPresent ()) {
244240 // For timestamp queries, first build the latest snapshot for resolution
245241 Snapshot latestSnapshot =
246- snapshotBuilder .withLogData (logData ).withMaxCatalogVersion (catalogVersion ).build (kernelEngine );
247- snapshotBuilder = TableManager .loadSnapshot (tablePath )
248- .atTimestamp (timestampOpt .get (), latestSnapshot );
242+ snapshotBuilder
243+ .withLogData (logData )
244+ .withMaxCatalogVersion (catalogVersion )
245+ .build (kernelEngine );
246+ snapshotBuilder =
247+ TableManager .loadSnapshot (tablePath ).atTimestamp (timestampOpt .get (), latestSnapshot );
249248 }
250249
251- return snapshotBuilder .withLogData (logData ).withMaxCatalogVersion (catalogVersion ).build (kernelEngine );
250+ return snapshotBuilder
251+ .withLogData (logData )
252+ .withMaxCatalogVersion (catalogVersion )
253+ .build (kernelEngine );
252254 }
253255
254- /**
255- * Internal method to load a commit range with version or timestamp boundaries.
256- */
256+ /** Internal method to load a commit range with version or timestamp boundaries. */
257257 private CommitRange loadCommitRangeInternal (
258258 Engine engine ,
259259 Optional <Long > startVersionOpt ,
@@ -286,58 +286,56 @@ private CommitRange loadCommitRangeInternal(
286286 CommitRangeBuilder builder = TableManager .loadCommitRange (tablePath );
287287
288288 if (startVersionOpt .isPresent ()) {
289- builder = builder .withStartBoundary (
290- CommitRangeBuilder .CommitBoundary .atVersion (startVersionOpt .get ()));
289+ builder =
290+ builder .withStartBoundary (
291+ CommitRangeBuilder .CommitBoundary .atVersion (startVersionOpt .get ()));
291292 }
292293 if (startTimestampOpt .isPresent ()) {
293294 Snapshot latestSnapshot = loadLatestSnapshot ();
294- builder = builder .withStartBoundary (
295- CommitRangeBuilder .CommitBoundary .atTimestamp (startTimestampOpt .get (), latestSnapshot ));
295+ builder =
296+ builder .withStartBoundary (
297+ CommitRangeBuilder .CommitBoundary .atTimestamp (
298+ startTimestampOpt .get (), latestSnapshot ));
296299 }
297300 if (endVersionOpt .isPresent ()) {
298- builder = builder . withEndBoundary (
299- CommitRangeBuilder .CommitBoundary .atVersion (endVersionOpt .get ()));
301+ builder =
302+ builder . withEndBoundary ( CommitRangeBuilder .CommitBoundary .atVersion (endVersionOpt .get ()));
300303 }
301304 if (endTimestampOpt .isPresent ()) {
302305 Snapshot latestSnapshot = loadLatestSnapshot ();
303- builder = builder .withEndBoundary (
304- CommitRangeBuilder .CommitBoundary .atTimestamp (endTimestampOpt .get (), latestSnapshot ));
306+ builder =
307+ builder .withEndBoundary (
308+ CommitRangeBuilder .CommitBoundary .atTimestamp (endTimestampOpt .get (), latestSnapshot ));
305309 }
306310
307311 return builder .withLogData (logData ).build (engine );
308312 }
309313
310- /**
311- * Converts catalog commits to Kernel's ParsedLogData format.
312- */
314+ /** Converts catalog commits to Kernel's ParsedLogData format. */
313315 private List <ParsedLogData > convertToKernelLogData (List <Commit > commits ) {
314316 return commits .stream ()
315317 .sorted (Comparator .comparingLong (Commit ::getVersion ))
316- .map (commit -> ParsedCatalogCommitData .forFileStatus (
317- hadoopFileStatusToKernelFileStatus (commit .getFileStatus ())))
318+ .map (
319+ commit ->
320+ ParsedCatalogCommitData .forFileStatus (
321+ hadoopFileStatusToKernelFileStatus (commit .getFileStatus ())))
318322 .collect (Collectors .toList ());
319323 }
320324
321- /**
322- * Converts Hadoop FileStatus to Kernel FileStatus.
323- */
325+ /** Converts Hadoop FileStatus to Kernel FileStatus. */
324326 private static io .delta .kernel .utils .FileStatus hadoopFileStatusToKernelFileStatus (
325327 org .apache .hadoop .fs .FileStatus hadoopFS ) {
326328 return io .delta .kernel .utils .FileStatus .of (
327329 hadoopFS .getPath ().toString (), hadoopFS .getLen (), hadoopFS .getModificationTime ());
328330 }
329331
330- /**
331- * Gets the true catalog version, handling the -1 case for newly created tables.
332- */
332+ /** Gets the true catalog version, handling the -1 case for newly created tables. */
333333 private long getCatalogVersion (long rawVersion ) {
334334 // UC returns -1 when only 0.json exists but hasn't been registered with UC
335335 return rawVersion == -1 ? 0 : rawVersion ;
336336 }
337337
338- /**
339- * Validates that the requested version exists.
340- */
338+ /** Validates that the requested version exists. */
341339 private void validateVersionExists (long version , long maxVersion ) {
342340 if (version > maxVersion ) {
343341 throw new IllegalArgumentException (
@@ -347,7 +345,8 @@ private void validateVersionExists(long version, long maxVersion) {
347345 }
348346 }
349347
350- private String getVersionOrTimestampString (Optional <Long > versionOpt , Optional <Long > timestampOpt ) {
348+ private String getVersionOrTimestampString (
349+ Optional <Long > versionOpt , Optional <Long > timestampOpt ) {
351350 if (versionOpt .isPresent ()) {
352351 return "version=" + versionOpt .get ();
353352 } else if (timestampOpt .isPresent ()) {
0 commit comments