simpledb.query
Class ProjectPlan

java.lang.Object
  extended by simpledb.query.ProjectPlan
All Implemented Interfaces:
Plan

public class ProjectPlan
extends Object
implements Plan

The Plan class corresponding to the project relational algebra operator.

Author:
Edward Sciore

Constructor Summary
ProjectPlan(Plan p, Collection<String> fieldlist)
          Creates a new project node in the query tree, having the specified subquery and field list.
 
Method Summary
 int blocksAccessed()
          Estimates the number of block accesses in the projection, which is the same as in the underlying query.
 int distinctValues(String fldname)
          Estimates the number of distinct field values in the projection, which is the same as in the underlying query.
 Scan open()
          Creates a project scan for this query.
 int recordsOutput()
          Estimates the number of output records in the projection, which is the same as in the underlying query.
 Schema schema()
          Returns the schema of the projection, which is taken from the field list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectPlan

public ProjectPlan(Plan p,
                   Collection<String> fieldlist)
Creates a new project node in the query tree, having the specified subquery and field list.

Parameters:
p - the subquery
fieldlist - the list of fields
Method Detail

open

public Scan open()
Creates a project scan for this query.

Specified by:
open in interface Plan
Returns:
a scan
See Also:
Plan.open()

blocksAccessed

public int blocksAccessed()
Estimates the number of block accesses in the projection, which is the same as in the underlying query.

Specified by:
blocksAccessed in interface Plan
Returns:
the estimated number of block accesses
See Also:
Plan.blocksAccessed()

recordsOutput

public int recordsOutput()
Estimates the number of output records in the projection, which is the same as in the underlying query.

Specified by:
recordsOutput in interface Plan
Returns:
the estimated number of output records
See Also:
Plan.recordsOutput()

distinctValues

public int distinctValues(String fldname)
Estimates the number of distinct field values in the projection, which is the same as in the underlying query.

Specified by:
distinctValues in interface Plan
Parameters:
fldname - the name of a field
Returns:
the estimated number of distinct field values in the output
See Also:
Plan.distinctValues(java.lang.String)

schema

public Schema schema()
Returns the schema of the projection, which is taken from the field list.

Specified by:
schema in interface Plan
Returns:
the query's schema
See Also:
Plan.schema()


Copyright © 2011. All Rights Reserved.