You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/02/09 12:06:02 UTC

[GitHub] [hive] zeroflag commented on a change in pull request #1733: HIVE-24346. Store HPL/SQL packages into HMS (amagyar)

zeroflag commented on a change in pull request #1733:
URL: https://github.com/apache/hive/pull/1733#discussion_r572830584



##########
File path: hplsql/src/test/queries/local/drop_package.sql
##########
@@ -0,0 +1,21 @@
+CREATE PACKAGE Counter AS
+  count INT := 0;
+  FUNCTION current() RETURNS INT;
+  PROCEDURE inc(i INT);
+END;
+
+CREATE PACKAGE BODY Counter AS
+  FUNCTION current() RETURNS INT IS BEGIN RETURN count; END;
+  PROCEDURE inc(i INT) IS BEGIN count := count + i; END;
+END;

Review comment:
       I would be happier with a single "create package" only but I don't think we can remove it since it's part of the language. I added more validation around creating the body+header.
   
   Unless "OR REPLACE" is specified, we don't replace the package header if there is header or body or both already exists. 
   
   If the body exits and one replaces the header (with OR REPLACE) then we create the header with a new empty body (This supposed to prevent having incompatible header + bodies).
   
   We don't allow replacing the body if it's already exists unless OR REPLACE is specified.
   
   Replacing the body to an existing header is allowed, it's the user's responsibility to ensure compatibility between those two. This is effectively the same as creating the header and the body later.
   




----------------------------------------------------------------
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:
users@infra.apache.org



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