You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by Apache Wiki <wi...@apache.org> on 2010/08/10 23:20:26 UTC
[Hadoop Wiki] Update of "Hive/LanguageManual/VirtualColumns" by HeYongqiang
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.
The "Hive/LanguageManual/VirtualColumns" page has been changed by HeYongqiang.
http://wiki.apache.org/hadoop/Hive/LanguageManual/VirtualColumns
--------------------------------------------------
New page:
<<TableOfContents>>
== Virtual Columns ==
Right now hive can only support 2 simple virtual columns:
One is {{{INPUT__FILE__NAME}}}, which is the input file's name for a mapper task.
the other is {{{BLOCK__OFFSET__INSIDE__FILE}}}, which is the current global file position.
For block compressed file, it is the current block's file offset, which is the current block's first byte's file offset.
=== Simple Examples ===
select {{{INPUT__FILE__NAME}}}, key, {{{BLOCK__OFFSET__INSIDE__FILE}}} from src;
select key, count({{{INPUT__FILE__NAME}}}) from src group by key order by key;
select * from src where {{{BLOCK__OFFSET__INSIDE__FILE}}} > 12000 order by key;