Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 654719CDF for ; Fri, 1 Jun 2012 20:28:24 +0000 (UTC) Received: (qmail 31142 invoked by uid 500); 1 Jun 2012 20:28:23 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 31076 invoked by uid 500); 1 Jun 2012 20:28:23 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 30689 invoked by uid 500); 1 Jun 2012 20:28:23 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 30639 invoked by uid 99); 1 Jun 2012 20:28:23 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2012 20:28:23 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 551751400E2 for ; Fri, 1 Jun 2012 20:28:23 +0000 (UTC) Date: Fri, 1 Jun 2012 20:28:23 +0000 (UTC) From: "Carl Steinbach (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: <706884139.28137.1338582503350.JavaMail.jiratomcat@issues-vm> In-Reply-To: <840956660.5735.1335581808155.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HIVE-2989) Adding Table Links to Hive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-2989?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13287= 643#comment-13287643 ]=20 Carl Steinbach commented on HIVE-2989: -------------------------------------- -1. This patch was committed two minutes after it was marked patch availabl= e which is unfair to the other committers. Also, there is still an ongoing = discussion regarding the design proposal. Please back this patch out. =20 > Adding Table Links to Hive > -------------------------- > > Key: HIVE-2989 > URL: https://issues.apache.org/jira/browse/HIVE-2989 > Project: Hive > Issue Type: Improvement > Components: Metastore, Query Processor, Security > Affects Versions: 0.10.0 > Reporter: Bhushan Mandhani > Assignee: Bhushan Mandhani > Attachments: HIVE-2989.1.patch.txt, HIVE-2989.2.patch.txt, HIVE-2= 989.3.patch.txt, HIVE-2989.4.patch.txt, HIVE-2989.5.patch.txt > > Original Estimate: 672h > Remaining Estimate: 672h > > This will add Table Links to Hive. This will be an alternate mechanism fo= r a user to access tables and data in a database that is different from the= one he is associated with. This feature can be used to provide access cont= rol (if access to databasename.tablename in queries and "use database X" is= turned off in conjunction). > If db X wants to access one or more partitions from table T in db Y, the = user will issue: > CREATE [STATIC] LINK TO T@Y LINKPROPERTIES ('RETENTION'=3D'N') > New partitions added to T will automatically be added to the link as well= and become available to X. However, if the link is specified to be static,= that will not be the case. The X user will then have to explicitly import = each partition of T that he needs. The command above will not actually make= any existing partitions of T available to X. Instead, we provide the follo= wing command to add an existing partition to a link: > ALTER LINK T@Y ADD PARTITION (ds=3D'2012-04-27') > The user will need to execute the above for each existing partition that = needs to be imported. For future partitions, Hive will take care of this. A= n imported partition can be dropped from a link using a similar command. We= just specify "DROP" instead of "ADD". For querying the linked table, the X= user will refer to it as T@Y. Link Tables will only have read access and n= ot be writable. The entire Table Link alongwith all its imported partitions= can be dropped as follows: > DROP LINK TO T@Y > The above commands are purely MetaStore operations. The implementation wi= ll rely on replicating the entire partition metadata when a partition is ad= ded to a link. For every link that is created, we will add a new row to ta= ble TBLS. The TBL_TYPE column will have a new kind of value "LINK_TABLE" (o= r "STATIC_LINK_TABLE" if the link has been specified as static). A new colu= mn LINK_TBL_ID will be added which will contain the id of the imported tabl= e. It will be NULL for all other table types including the regular managed = tables. When a partition is added to a link, the new row in the table PARTI= TIONS will point to the LINK_TABLE in the same database and not the master= table in the other database. We will replicate all the metadata for this p= artition from the master database. The advantage of this approach is that f= ewer changes will be needed in query processing and DDL for LINK_TABLEs. Al= so, commands like "SHOW TABLES" and "SHOW PARTITIONS" will work as expected= for LINK_TABLEs too. Of course, even though the metadata is not shared, th= e underlying data on disk is still shared. Hive still needs to know that wh= en dropping a partition which belongs to a LINK_TABLE, it should not drop t= he underlying data from HDFS. Views and external tables cannot be imported = from one database to another. > =20 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira