Skip to content

Commit

Permalink
Merge branch '0.3' into 0.4
Browse files Browse the repository at this point in the history
* 0.3:
  runWithContextClassLoader in getNextPage to solve classloader issue
  • Loading branch information
JingsongLi committed Mar 19, 2023
2 parents 0fefe29 + 9c493a8 commit f09ea51
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;

import static io.airlift.slice.Slices.wrappedBuffer;
import static io.trino.spi.StandardErrorCode.GENERIC_INTERNAL_ERROR;
Expand Down Expand Up @@ -109,11 +110,13 @@ public boolean isFinished() {

@Override
public Page getNextPage() {
try {
return nextPage();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return ClassLoaderUtils.runWithContextClassLoader(() -> {
try {
return nextPage();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}, TrinoPageSourceBase.class.getClassLoader());
}

private Page nextPage() throws IOException {
Expand Down

0 comments on commit f09ea51

Please sign in to comment.