hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Hadoop Wiki] Update of "Hive/ViewDev" by JohnSichi
Date Fri, 08 Jan 2010 00:24:14 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.

The "Hive/ViewDev" page has been changed by JohnSichi.
http://wiki.apache.org/hadoop/Hive/ViewDev?action=diff&rev1=8&rev2=9

--------------------------------------------------

  Implementing this typically requires expanding the view definition into an explicit form
rather than storing the original view definition text directly.  Doing this could require
adding "unparse" support to the AST model (to be applied after object name resolution takes
place), something which is not currently present (and which is also useful to have available
in general).
  
  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 functionality (see later section on
ALTER VIEW v RECOMPILE).
+ 
+ '''Update 7-Jan-2010''':  Rather than adding full-blown unparse support to the AST model,
I'm taking a parser-dependent shortcut.  ANTLR's TokenRewriteStream provides a way to substitute
text for token subsequences from the original token stream and then regenerate a transformed
version of the parsed 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 resolved, 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 unchanged.  
+ 
+ This approach will break if we ever need to perform more drastic (AST-based) rewrites as
part of view expansion in the future.
  
  == Metastore Modeling ==
  

Mime
View raw message