public String getCreateViewCommand(Table table, boolean isRelative) {
    ST command = new ST(CREATE_VIEW_TEMPLATE);

    if (!isRelative) {
      command.add(DATABASE_NAME, unparseIdentifier(table.getDbName()));
    }
    command.add(TABLE_NAME, unparseIdentifier(table.getTableName()));
    command.add(PARTITIONS, getPartitionsForView(table));
    command.add(SQL, table.getViewExpandedText());

    return command.render();
  }
Returns the create view statement for the given view.

@param table
@return create view statement.
ql/src/java/org/apache/hadoop/hive/ql/exec/DDLPlanUtils.java