You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "mdayakar (via GitHub)" <gi...@apache.org> on 2023/05/23 05:36:42 UTC

[GitHub] [hive] mdayakar commented on a diff in pull request #4330: HIVE-27349: Move HMS call to get stored procedure out of Udf

mdayakar commented on code in PR #4330:
URL: https://github.com/apache/hive/pull/4330#discussion_r1201532676


##########
hplsql/src/main/java/org/apache/hive/hplsql/udf/Udf.java:
##########
@@ -66,48 +64,25 @@ public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumen
     if (!(arguments[0] instanceof StringObjectInspector)) {

Review Comment:
   Now it requires minimum two arguments so validation can be changed. Also second argument should be StringObjectInspector type so this check can also be added.



##########
hplsql/src/main/java/org/apache/hive/hplsql/Exec.java:
##########
@@ -1870,12 +1878,30 @@ private boolean execUserSql(HplsqlParser.Expr_func_paramsContext ctx, String nam
         sql.append(", ");
       }
     }
-    sql.append(")");
+    sql.append(", \"");
+    sql.append(getStoredProcedure(name.toUpperCase()));

Review Comment:
   What will happen if `getStoredProcedure(name.toUpperCase()) `returns null (in case the function is not registered as a HPL/SQL function). I feel this scenario is not handled, please check once.



-- 
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-unsubscribe@hive.apache.org

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


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