public class Project extends Operator
| Modifier and Type | Field and Description |
|---|---|
private DbIterator |
child |
private java.util.ArrayList<java.lang.Integer> |
outFieldIds |
private static long |
serialVersionUID |
private TupleDesc |
td |
| Constructor and Description |
|---|
Project(java.util.ArrayList<java.lang.Integer> fieldList,
java.util.ArrayList<Type> typesList,
DbIterator child)
Constructor accepts a child operator to read tuples to apply projection
to and a list of fields in output tuple
|
Project(java.util.ArrayList<java.lang.Integer> fieldList,
Type[] types,
DbIterator child) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this iterator.
|
protected Tuple |
fetchNext()
Operator.fetchNext implementation.
|
DbIterator[] |
getChildren() |
TupleDesc |
getTupleDesc()
Returns the TupleDesc associated with this DbIterator.
|
void |
open()
Opens the iterator.
|
void |
rewind()
Resets the iterator to the start.
|
void |
setChildren(DbIterator[] children)
Set the children(child) of this operator.
|
getEstimatedCardinality, hasNext, next, setEstimatedCardinalityprivate static final long serialVersionUID
private DbIterator child
private TupleDesc td
private java.util.ArrayList<java.lang.Integer> outFieldIds
public Project(java.util.ArrayList<java.lang.Integer> fieldList,
java.util.ArrayList<Type> typesList,
DbIterator child)
fieldList - The ids of the fields child's tupleDesc to project outtypesList - the types of the fields in the final projectionchild - The child operatorpublic Project(java.util.ArrayList<java.lang.Integer> fieldList,
Type[] types,
DbIterator child)
public TupleDesc getTupleDesc()
DbIteratorgetTupleDesc in interface DbIteratorgetTupleDesc in class Operatorpublic void open()
throws DbException,
java.util.NoSuchElementException,
TransactionAbortedException
DbIteratoropen in interface DbIteratoropen in class OperatorDbException - when there are problems opening/accessing the database.java.util.NoSuchElementExceptionTransactionAbortedExceptionpublic void close()
Operatorclose in interface DbIteratorclose in class Operatorpublic void rewind()
throws DbException,
TransactionAbortedException
DbIteratorDbException - when rewind is unsupported.TransactionAbortedExceptionprotected Tuple fetchNext() throws java.util.NoSuchElementException, TransactionAbortedException, DbException
fetchNext in class Operatorjava.util.NoSuchElementExceptionTransactionAbortedExceptionDbExceptionpublic DbIterator[] getChildren()
getChildren in class Operatorpublic void setChildren(DbIterator[] children)
OperatorsetChildren in class Operatorchildren - the DbIterators which are to be set as the children(child) of
this operator