luoyuxia commented on code in PR #20469:
URL: https://github.com/apache/flink/pull/20469#discussion_r943034014


##########
flink-connectors/flink-connector-files/src/main/java/org/apache/flink/connector/file/table/FileSystemOutputFormat.java:
##########
@@ -81,11 +91,29 @@ private FileSystemOutputFormat(
         this.formatFactory = formatFactory;
         this.computer = computer;
         this.outputFileConfig = outputFileConfig;
+        this.identifier = identifier;
+        this.policyKind = policyKind;
+        this.customClass = customClass;
+        this.successFileName = successFileName;
     }
 
     @Override
     public void finalizeGlobal(int parallelism) {
         try {
+            List<PartitionCommitPolicy> policies =
+                    PartitionCommitPolicy.createPolicyChain(
+                            Thread.currentThread().getContextClassLoader(),

Review Comment:
   Use `Thread.currentThread().getContextClassLoader()` to load user class may 
casue class not found issue.
   I think we can make `FileSystemOutputFormat` extend `RichOutputFormat` and 
use `getRuntimeContext().getUserCodeClassLoader()`.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to