[
https://issues.apache.org/jira/browse/HIVE-24346?focusedWorklogId=544371&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-544371
]
ASF GitHub Bot logged work on HIVE-24346:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 29/Jan/21 17:16
Start Date: 29/Jan/21 17:16
Worklog Time Spent: 10m
Work Description: zeroflag commented on a change in pull request #1733:
URL: https://github.com/apache/hive/pull/1733#discussion_r566971532
##########
File path: hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
##########
@@ -1425,30 +1450,40 @@ public Integer
visitCreate_function_stmt(HplsqlParser.Create_function_stmtContex
@Override
public Integer
visitCreate_package_stmt(HplsqlParser.Create_package_stmtContext ctx) {
String name = ctx.ident(0).getText().toUpperCase();
- exec.currentPackageDecl = new Package(name, exec, builtinFunctions);
- exec.packages.put(name, exec.currentPackageDecl);
- trace(ctx, "CREATE PACKAGE");
- exec.currentPackageDecl.createSpecification(ctx);
- exec.currentPackageDecl = null;
+ if (exec.packageLoading) {
+ exec.currentPackageDecl = new Package(name, exec, builtinFunctions);
+ exec.packages.put(name, exec.currentPackageDecl);
+ exec.currentPackageDecl.createSpecification(ctx);
+ exec.currentPackageDecl = null;
+ } else {
+ trace(ctx, "CREATE PACKAGE");
+ exec.packages.remove(name);
+ exec.packageRegistry.createPackage(name, getFormattedText(ctx));
+ }
return 0;
}
/**
* CREATE PACKAGE body statement
*/
@Override
- public Integer
visitCreate_package_body_stmt(HplsqlParser.Create_package_body_stmtContext ctx)
{
+ public Integer
visitCreate_package_body_stmt(HplsqlParser.Create_package_body_stmtContext ctx)
{
String name = ctx.ident(0).getText().toUpperCase();
- exec.currentPackageDecl = exec.packages.get(name);
- if (exec.currentPackageDecl == null) {
- exec.currentPackageDecl = new Package(name, exec, builtinFunctions);
- exec.currentPackageDecl.setAllMembersPublic(true);
- exec.packages.put(name, exec.currentPackageDecl);
+ if (exec.packageLoading) {
Review comment:
I don't know any better. The same codepath is triggered when creating
and when loading a package, somehow we need to differentiate between those two.
----------------------------------------------------------------
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: 544371)
Time Spent: 5h 20m (was: 5h 10m)
> Store HPL/SQL packages into HMS
> -------------------------------
>
> Key: HIVE-24346
> URL: https://issues.apache.org/jira/browse/HIVE-24346
> Project: Hive
> Issue Type: Sub-task
> Components: hpl/sql, Metastore
> Reporter: Attila Magyar
> Assignee: Attila Magyar
> Priority: Major
> Labels: pull-request-available
> Time Spent: 5h 20m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)