deniskuzZ commented on code in PR #5703:
URL: https://github.com/apache/hive/pull/5703#discussion_r2104472437


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java:
##########
@@ -2411,6 +2415,38 @@ private boolean getOnlyStructObjectInspectors(ReduceWork 
reduceWork,
     }
   }
 
+  private void addCustomUDFs(HiveConf hiveConf) {

Review Comment:
   Use the session classloader and return fast when mode is CHOSEN
   ````
     private void addCustomUDFs(HiveConf hiveConf) {
       if (hiveConf == null) {
         return;
       }
       if (HiveVectorAdaptorUsageMode.CHOSEN != 
HiveVectorAdaptorUsageMode.getHiveConfValue(hiveConf)) {
         return;
       }
       String[] udfs = HiveConf.getTrimmedStringsVar(hiveConf, 
           HiveConf.ConfVars.HIVE_VECTOR_ADAPTOR_CUSTOM_UDF_WHITELIST);
       if (udfs == null) {
         return;
       }
       ClassLoader loader = Utilities.getSessionSpecifiedClassLoader();
       
       for (String udf : udfs) {
         try {
           Class<?> udfClass = Class.forName(udf, true, loader);
           if (GenericUDF.class.isAssignableFrom(udfClass)) {
             supportedGenericUDFs.add(udfClass);
           } else {
             LOG.warn("{} is not a valid GenericUDF class", udf);
           }
         } catch (ClassNotFoundException e) {
           LOG.warn("Unable to load UDF class: {}", udf, 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: gitbox-unsubscr...@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to