org.apache.hadoop.hive.ql
Class Driver

java.lang.Object
  extended by org.apache.hadoop.hive.ql.Driver
All Implemented Interfaces:
CommandProcessor

public class Driver
extends Object
implements CommandProcessor


Constructor Summary
Driver()
           
Driver(HiveConf conf)
          for backwards compatibility with current tests
 
Method Summary
 int close()
           
 int compile(String command)
          Compile a new query.
 int countJobs(List<Task<? extends Serializable>> tasks)
           
 int countJobs(List<Task<? extends Serializable>> tasks, List<Task<? extends Serializable>> seenTasks)
           
 int execute()
           
 org.apache.hadoop.mapred.ClusterStatus getClusterStatus()
          Return the status information about the Map-Reduce cluster
 int getMaxRows()
          Return the maximum number of rows returned by getResults
 QueryPlan getPlan()
           
 boolean getResults(Vector<String> res)
           
 Schema getSchema()
          Get a Schema with fields represented with native Hive types
 Schema getThriftSchema()
          Get a Schema with fields represented with Thrift DDL types
 boolean hasReduceTasks(List<Task<? extends Serializable>> tasks)
           
 int run(String command)
           
 void setMaxRows(int maxRows)
          Set the maximum number of rows returned by getResults
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Driver

public Driver(HiveConf conf)
for backwards compatibility with current tests


Driver

public Driver()
Method Detail

countJobs

public int countJobs(List<Task<? extends Serializable>> tasks)

countJobs

public int countJobs(List<Task<? extends Serializable>> tasks,
                     List<Task<? extends Serializable>> seenTasks)

getClusterStatus

public org.apache.hadoop.mapred.ClusterStatus getClusterStatus()
                                                        throws Exception
Return the status information about the Map-Reduce cluster

Throws:
Exception

getSchema

public Schema getSchema()
                 throws Exception
Get a Schema with fields represented with native Hive types

Throws:
Exception

getThriftSchema

public Schema getThriftSchema()
                       throws Exception
Get a Schema with fields represented with Thrift DDL types

Throws:
Exception

getMaxRows

public int getMaxRows()
Return the maximum number of rows returned by getResults


setMaxRows

public void setMaxRows(int maxRows)
Set the maximum number of rows returned by getResults


hasReduceTasks

public boolean hasReduceTasks(List<Task<? extends Serializable>> tasks)

compile

public int compile(String command)
Compile a new query. Any currently-planned query associated with this Driver is discarded.

Parameters:
command - The SQL query to compile.

getPlan

public QueryPlan getPlan()
Returns:
The current query plan associated with this Driver, if any.

run

public int run(String command)
Specified by:
run in interface CommandProcessor

execute

public int execute()

getResults

public boolean getResults(Vector<String> res)
                   throws IOException
Throws:
IOException

close

public int close()


Copyright © 2009 The Apache Software Foundation