public void addTableNameTranslation(ASTNode tableName, String currentDatabaseName) {
    if (!enabled) {
      return;
    }
    if (tableName.getToken().getType() == HiveParser.Identifier) {
      addIdentifierTranslation(tableName);
      return;
    }
    assert (tableName.getToken().getType() == HiveParser.TOK_TABNAME);
    assert (tableName.getChildCount() <= 3);

    if (tableName.getChildCount() == 2 || tableName.getChildCount() == 3) {
      addIdentifierTranslation((ASTNode)tableName.getChild(0));
      addIdentifierTranslation((ASTNode)tableName.getChild(1));
      if (tableName.getChildCount() == 3) {
        addIdentifierTranslation((ASTNode)tableName.getChild(2));
      }
    }
    else {
      // transform the table reference to an absolute reference (i.e., "db.table")
      StringBuilder replacementText = new StringBuilder();
      replacementText.append(HiveUtils.unparseIdentifier(currentDatabaseName, quotation));
      replacementText.append('.');

      ASTNode identifier = (ASTNode)tableName.getChild(0);
      String identifierText = BaseSemanticAnalyzer.unescapeIdentifier(identifier.getText());
      replacementText.append(HiveUtils.unparseIdentifier(identifierText, quotation));

      addTranslation(identifier, replacementText.toString());
    }
  }
Register a translation for an tabName.

@param tableName
         source node (which must be an tabName) to be replaced
ql/src/java/org/apache/hadoop/hive/ql/parse/UnparseTranslator.java