Skip to content

Commit

Permalink
Remove Kernel class loader workaround that was fixed in upstream with…
Browse files Browse the repository at this point in the history
… 3.2.1.

See delta-io/delta#3304
  • Loading branch information
abhishekrb19 committed Sep 27, 2024
1 parent 57d1453 commit 577feda
Showing 1 changed file with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,20 +340,10 @@ private CloseableIterator<FilteredColumnarBatch> getTransformedDataIterator(

private Snapshot getSnapshotForTable(final Table table, final Engine engine)
{
// Setting the LogStore class loader before calling the Delta Kernel snapshot API is required as a workaround with
// the 3.2.0 Delta Kernel because the Kernel library cannot instantiate the LogStore class otherwise. Please see
// https://github.com/delta-io/delta/issues/3299 for details. This workaround can be removed once the issue is fixed.
final ClassLoader currCtxCl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(LogStore.class.getClassLoader());
if (snapshotVersion != null) {
return table.getSnapshotAsOfVersion(engine, snapshotVersion);
} else {
return table.getLatestSnapshot(engine);
}
}
finally {
Thread.currentThread().setContextClassLoader(currCtxCl);
if (snapshotVersion != null) {
return table.getSnapshotAsOfVersion(engine, snapshotVersion);
} else {
return table.getLatestSnapshot(engine);
}
}

Expand Down

0 comments on commit 577feda

Please sign in to comment.