Return-Path: Delivered-To: apmail-hadoop-hive-dev-archive@minotaur.apache.org Received: (qmail 81138 invoked from network); 13 Apr 2010 21:10:25 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Apr 2010 21:10:25 -0000 Received: (qmail 12409 invoked by uid 500); 13 Apr 2010 21:10:25 -0000 Delivered-To: apmail-hadoop-hive-dev-archive@hadoop.apache.org Received: (qmail 12319 invoked by uid 500); 13 Apr 2010 21:10:25 -0000 Mailing-List: contact hive-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hadoop.apache.org Delivered-To: mailing list hive-dev@hadoop.apache.org Received: (qmail 12311 invoked by uid 99); 13 Apr 2010 21:10:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Apr 2010 21:10:25 +0000 X-ASF-Spam-Status: No, hits=-1280.7 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Apr 2010 21:10:23 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3DLA3xp009379 for ; Tue, 13 Apr 2010 17:10:03 -0400 (EDT) Message-ID: <22420726.73291271193003521.JavaMail.jira@thor> Date: Tue, 13 Apr 2010 17:10:03 -0400 (EDT) From: "John Sichi (JIRA)" To: hive-dev@hadoop.apache.org Subject: [jira] Updated: (HIVE-1096) Hive Variables In-Reply-To: <2024420157.16891264445974604.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-1096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] John Sichi updated HIVE-1096: ----------------------------- Status: Open (was: Patch Available) I'm getting a conflict with latest trunk--can you regenerate the patch? (Use filename HIVE-1096.10.patch to follow the usual convention.) Sorry it took us so long to get to this one; here are a few review comments to be addressed as part of a new patch: * add a test with a query which references the same variable twice * add a test which references a built-in variable such as hive.map.aggr * add a test with hive.variable.replace=false to verify that expansion does not happen when the variable is turned off (reference the variable in a literal string) * add a test which references a variable which has not been set * for description, change "This setting controls if hive will..." to "Whether hive will..." * rename method to replaceVariableReferences * for the LOG.info's, add a space after the colon, and change "replacement" to "variable replacement" for clarity * run ant checkstyle and fix some issues with spaces before braces and arglists * to optimize the replacement, you could do a contains("${") precheck before looping over conf * if you want to allow for uber-cool recursive variable expansion, change if (command.contains(s)) to a while instead > Hive Variables > -------------- > > Key: HIVE-1096 > URL: https://issues.apache.org/jira/browse/HIVE-1096 > Project: Hadoop Hive > Issue Type: New Feature > Reporter: Edward Capriolo > Assignee: Edward Capriolo > Attachments: 1096-9.diff, hive-1096-2.diff, hive-1096-7.diff, hive-1096-8.diff, hive-1096.diff > > > From mailing list: > --Amazon Elastic MapReduce version of Hive seems to have a nice feature called "Variables." Basically you can define a variable via command-line while invoking hive with -d DT=2009-12-09 and then refer to the variable via ${DT} within the hive queries. This could be extremely useful. I can't seem to find this feature even on trunk. Is this feature currently anywhere in the roadmap?-- > This could be implemented in many places. > A simple place to put this is > in Driver.compile or Driver.run we can do string substitutions at that level, and further downstream need not be effected. > There could be some benefits to doing this further downstream, parser,plan. but based on the simple needs we may not need to overthink this. > I will get started on implementing in compile unless someone wants to discuss this more. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira