[
https://issues.apache.org/jira/browse/HIVE-12703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15942013#comment-15942013
]
Pengcheng Xiong commented on HIVE-12703:
----------------------------------------
Hello, I am deferring this to Hive 3.0 as we are going to cut the first RC and
it is not marked as blocker. Please feel free to commit to the branch if this
can be resolved before the release.
> CLI agnostic HQL import command implementation
> ----------------------------------------------
>
> Key: HIVE-12703
> URL: https://issues.apache.org/jira/browse/HIVE-12703
> Project: Hive
> Issue Type: New Feature
> Components: Hive
> Affects Versions: 2.0.0
> Reporter: Elliot West
> Assignee: Elliot West
> Labels: hql
>
> _As an HQL developer_
> _I'd like a single command to import HQL script files, that works across all
> Hive CLIs and shells_
> _So that I can compose larger scripts from smaller components irrespective of
> my Hive execution environment._
> h3. Motivation
> Current Hive CLIs include commands that allow the user to effectively import
> and execute HQL scripts from a file. The {{hive}} CLI provides the {{SOURCE}}
> command and {{beeline}} provides the {{!run}} command. This allows HQL
> developers to decompose complex HQL processes into multiple HQL scripts
> files. These can be individually executed or tested, and in the case of
> {{MACROs}}, imported in a manner similar to a functionary library. These
> 'source' commands allow HQL developers to compose these smaller modules
> purely in the domain of Hive (i.e. no external shell such as {{bash}} is
> needed).
> However, this seems to be a feature of the individual CLIs and not part of
> the core HQL language. Consequently this can lead to the development of Hive
> processes that are not portable across different execution contexts, even for
> the same version of Hive.
> h3. Proposal
> The ability to compose and encapsulate logic is a fundamental building block
> of any scalable language and therefore I believe that this functionality
> should be available in the core HQL language and not just implemented in the
> CLIs. I propose that the {{SOURCE}} command be a first class citizen of the
> HQL language and is available consistently in all execution contexts.
> h3. References
> * [{{SOURCE}} implementation in the {{hive}}
> CLI.|https://github.com/apache/hive/blob/0ae374a320d1cae523ba2b434800e97692507db8/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java#L137]
> * [{{SOURCE}}
> documentation.|https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Cli#LanguageManualCli-HiveInteractiveShellCommands]
> * [{{!run}} implementation in
> {{beeline}}.|https://github.com/apache/hive/blob/master/beeline/src/java/org/apache/hive/beeline/Commands.java#L1535]
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)