Unverified Commit 947fca25 authored by Licho's avatar Licho Committed by GitHub

fix: fix initPythonUDF function not check udfList paramepter is empty. (#1142)

* fix: fix initPythonUDF function not check udfList paramepter is empty.

* Update UDFServiceImpl.java

* chore: format
parent 87c494cb
...@@ -94,12 +94,12 @@ public class UDFServiceImpl implements UDFService { ...@@ -94,12 +94,12 @@ public class UDFServiceImpl implements UDFService {
} }
private static String[] initPythonUDF(List<UDF> udfList) { private static String[] initPythonUDF(List<UDF> udfList) {
return (udfList.size() > 0) ? new String[] {UDFUtil.buildPy(udfList)} : new String[] {}; return udfList == null || udfList.isEmpty() ? new String[0] : new String[] {UDFUtil.buildPy(udfList)};
} }
private static String[] initJavaUDF(List<UDF> udfList) { private static String[] initJavaUDF(List<UDF> udfList) {
Opt<String> udfJarPath = Opt.empty(); Opt<String> udfJarPath = Opt.empty();
if (udfList.size() > 0) { if (!udfList.isEmpty()) {
udfJarPath = Opt.ofBlankAble(UDFUtil.getUdfFileAndBuildJar(udfList)); udfJarPath = Opt.ofBlankAble(UDFUtil.getUdfFileAndBuildJar(udfList));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment