hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiroyuki Yamada <>
Subject How to replace a input table name inside Hive (How Hive pass input file names to Hadoop ?)
Date Thu, 27 Oct 2011 08:16:19 GMT

I am trying to understand how hive compiles and opmizes HiveQL queries
for future development.
I would like to know how to replace a input table name in the
compilation process.
For example,
the following HiveQL is queried,

SELECT l_orderkey FROM lineitem WHERE l_shipdate < '1993-01-01';

, and I want to input "lineitem_copy" file instead of lineitem.
(lineitem_copy is also created beforehand.)

I looked into many of the codes, but I could't do that.
I modified some Table objects ans aliases like the following code, but
they didn't work.
(objects are actually changed, but I think it's not referenced from
so lineitem is actually read in.)

in parse/
public void analyzeInternal(ASTNode ast) throws SemanticException {

   // complilations and optimizations

   for (String alias : qb.getMetaData().getAliasToTable().keySet()) {
      Table table = qb.getMetaData().getTableForAlias(alias);
      table.setTableName(table.getTableName() + "_copy");
      qb.setTabAlias(alias, qb.getTabNameForAlias(alias) + "_ext");

   genMapRedTasks(qb);"Completed plan generation");



How Hive pass input file names to Hadoop ?
And, is there any way I can achieve this or any hints ?

View raw message