Return-Path: Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: (qmail 16380 invoked from network); 8 Jan 2010 00:24:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Jan 2010 00:24:38 -0000 Received: (qmail 76508 invoked by uid 500); 8 Jan 2010 00:24:38 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 76440 invoked by uid 500); 8 Jan 2010 00:24:38 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 76431 invoked by uid 500); 8 Jan 2010 00:24:38 -0000 Delivered-To: apmail-hadoop-core-commits@hadoop.apache.org Received: (qmail 76428 invoked by uid 99); 8 Jan 2010 00:24:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jan 2010 00:24:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jan 2010 00:24:35 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id E583C1781C; Fri, 8 Jan 2010 00:24:14 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Fri, 08 Jan 2010 00:24:14 -0000 Message-ID: <20100108002414.24018.72620@eos.apache.org> Subject: =?utf-8?q?=5BHadoop_Wiki=5D_Update_of_=22Hive/ViewDev=22_by_JohnSichi?= X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for ch= ange notification. The "Hive/ViewDev" page has been changed by JohnSichi. http://wiki.apache.org/hadoop/Hive/ViewDev?action=3Ddiff&rev1=3D8&rev2=3D9 -------------------------------------------------- Implementing this typically requires expanding the view definition into a= n explicit form rather than storing the original view definition text direc= tly. Doing this could require adding "unparse" support to the AST model (t= o be applied after object name resolution takes place), something which is = not currently present (and which is also useful to have available in genera= l). = However, storing both the expanded form and the original view definition = text as well can also be useful for both DESCRIBE readability as well as fu= nctionality (see later section on ALTER VIEW v RECOMPILE). + = + '''Update 7-Jan-2010''': Rather than adding full-blown unparse support t= o the AST model, I'm taking a parser-dependent shortcut. ANTLR's TokenRewr= iteStream provides a way to substitute text for token subsequences from the= original token stream and then regenerate a transformed version of the par= sed text. So, during column resolution, we map an expression such as "t.*"= to replacement text "t.c1, t.c2, t.c3". Then once all columns have been r= esolved, we regenerate the view definition using these mapped replacements.= Likewise, an unqualified column reference such as "c" gets replaced with = the qualified reference "t.c". The rest of the parsed text remains unchang= ed. = + = + This approach will break if we ever need to perform more drastic (AST-bas= ed) rewrites as part of view expansion in the future. = =3D=3D Metastore Modeling =3D=3D =20