morningman commented on code in PR #30483:
URL: https://github.com/apache/doris/pull/30483#discussion_r1470485939
##########
fe/be-java-extensions/paimon-scanner/src/main/java/org/apache/doris/paimon/PaimonJniScanner.java:
##########
@@ -87,9 +89,18 @@ public PaimonJniScanner(int batchSize, Map<String, String>
params) {
@Override
public void open() throws IOException {
- initTable();
- initReader();
- resetDatetimeV2Precision();
+ try {
+ Thread.currentThread().setContextClassLoader(classLoader);
Review Comment:
Add comment in code to explain why need class loader
##########
fe/be-java-extensions/paimon-scanner/src/main/java/org/apache/doris/paimon/PaimonJniScanner.java:
##########
@@ -87,9 +89,18 @@ public PaimonJniScanner(int batchSize, Map<String, String>
params) {
@Override
public void open() throws IOException {
- initTable();
- initReader();
- resetDatetimeV2Precision();
+ try {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ initTable();
+ initReader();
+ resetDatetimeV2Precision();
+ } catch (Exception e) {
+ LOG.warn("Failed to open paimon_scanner: " + e.getMessage());
Review Comment:
It will print the stack trace
##########
fe/be-java-extensions/paimon-scanner/src/main/java/org/apache/doris/paimon/PaimonJniScanner.java:
##########
@@ -87,9 +89,18 @@ public PaimonJniScanner(int batchSize, Map<String, String>
params) {
@Override
public void open() throws IOException {
- initTable();
- initReader();
- resetDatetimeV2Precision();
+ try {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ initTable();
+ initReader();
+ resetDatetimeV2Precision();
+ } catch (Exception e) {
+ LOG.warn("Failed to open paimon_scanner: " + e.getMessage());
Review Comment:
U can just use:
```suggestion
LOG.warn("Failed to open paimon_scanner: " + e.getMessage(), e);
```
--
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]