[ 
https://issues.apache.org/jira/browse/BEAM-10925?focusedWorklogId=543956&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-543956
 ]

ASF GitHub Bot logged work on BEAM-10925:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/Jan/21 01:32
            Start Date: 29/Jan/21 01:32
    Worklog Time Spent: 10m 
      Work Description: ibzib commented on a change in pull request #13835:
URL: https://github.com/apache/beam/pull/13835#discussion_r566520922



##########
File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamCalcRel.java
##########
@@ -232,15 +245,22 @@ public Calc copy(RelTraitSet traitSet, RelNode input, 
RexProgram program) {
   private static class CalcFn extends DoFn<Row, Row> {
     private final String processElementBlock;
     private final Schema outputSchema;
+    private final List<String> jarPaths;
     private transient @Nullable ScriptEvaluator se = null;
 
-    public CalcFn(String processElementBlock, Schema outputSchema) {
+    public CalcFn(String processElementBlock, Schema outputSchema, 
List<String> jarPaths) {
       this.processElementBlock = processElementBlock;
       this.outputSchema = outputSchema;
+      this.jarPaths = jarPaths;
     }
 
-    ScriptEvaluator compile() {
+    ScriptEvaluator compile() throws IOException {
       ScriptEvaluator se = new ScriptEvaluator();
+      if (!jarPaths.isEmpty()) {
+        JavaUdfLoader udfLoader = new JavaUdfLoader();
+        ClassLoader classLoader = udfLoader.createClassLoader(jarPaths);
+        se.setParentClassLoader(classLoader);

Review comment:
       The new classloader replaces the default one, but that is okay. The 
classloader we construct does not only contain the UDF jars. It also has a 
parent classloader, which is the same as the default one.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 543956)
    Time Spent: 35h 40m  (was: 35.5h)

> ZetaSQL: Support Java UDF
> -------------------------
>
>                 Key: BEAM-10925
>                 URL: https://issues.apache.org/jira/browse/BEAM-10925
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql-zetasql
>            Reporter: Kyle Weaver
>            Assignee: Kyle Weaver
>            Priority: P2
>          Time Spent: 35h 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to