net.sf.farrago.namespace.jdbc
Class MedJdbcColumnSet

java.lang.Object
  extended by org.eigenbase.relopt.RelOptAbstractTable
      extended by net.sf.farrago.namespace.impl.MedAbstractColumnSet
          extended by net.sf.farrago.namespace.jdbc.MedJdbcColumnSet
All Implemented Interfaces:
FarragoMedColumnSet, FarragoQueryColumnSet, RelOptTable, SqlValidatorTable

public class MedJdbcColumnSet
extends MedAbstractColumnSet

MedJdbcColumnSet implements the FarragoMedColumnSet interface for foreign JDBC tables.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/namespace/jdbc/MedJdbcColumnSet.java#21 $
Author:
John V. Sichi

Field Summary
(package private)  RelDataType currRowType
           
(package private)  SqlDialect dialect
           
(package private)  MedJdbcNameDirectory directory
           
(package private)  RelDataType origRowType
           
(package private)  SqlSelect select
           
(package private)  RelDataType srcRowType
           
 
Fields inherited from class org.eigenbase.relopt.RelOptAbstractTable
name, rowType, schema
 
Constructor Summary
MedJdbcColumnSet(MedJdbcNameDirectory directory, String[] foreignName, String[] localName, SqlSelect select, SqlDialect dialect, RelDataType rowType, RelDataType origRowType, RelDataType srcRowType)
           
 
Method Summary
 SqlDialect getDialect()
           
 MedJdbcNameDirectory getDirectory()
           
 double getRowCount()
          Returns an estimate of the number of rows in the table.
private  RelNode optimizeLoopbackLink(RelOptCluster cluster, RelOptConnection connection)
           
protected  RelNode optimizeLoopbackLink(RelOptCluster cluster, RelOptConnection connection, String[] actualName)
           
 RelNode toRel(RelOptCluster cluster, RelOptConnection connection)
          Converts this table into a relational expression.
 
Methods inherited from class net.sf.farrago.namespace.impl.MedAbstractColumnSet
getAllowedAccess, getColumnPropertyMap, getCwmColumnSet, getForeignName, getLocalName, getMonotonicity, getPreparingStmt, getQualifiedName, getTableProperties, setAllowedAccess, setCwmColumnSet, setPreparingStmt, toLenientRel, toUdxRel
 
Methods inherited from class org.eigenbase.relopt.RelOptAbstractTable
getCollationList, getName, getRelOptSchema, getRowType, setRowType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eigenbase.relopt.RelOptTable
getCollationList, getRelOptSchema, getRowType
 
Methods inherited from interface org.eigenbase.sql.validate.SqlValidatorTable
getRowType
 

Field Detail

directory

final MedJdbcNameDirectory directory

select

final SqlSelect select

dialect

final SqlDialect dialect

origRowType

RelDataType origRowType

srcRowType

RelDataType srcRowType

currRowType

RelDataType currRowType
Constructor Detail

MedJdbcColumnSet

public MedJdbcColumnSet(MedJdbcNameDirectory directory,
                        String[] foreignName,
                        String[] localName,
                        SqlSelect select,
                        SqlDialect dialect,
                        RelDataType rowType,
                        RelDataType origRowType,
                        RelDataType srcRowType)
Method Detail

getRowCount

public double getRowCount()
Description copied from interface: RelOptTable
Returns an estimate of the number of rows in the table.

Specified by:
getRowCount in interface RelOptTable
Overrides:
getRowCount in class RelOptAbstractTable

getDirectory

public MedJdbcNameDirectory getDirectory()
Returns:
the directory from which this columnset originates

getDialect

public SqlDialect getDialect()
Returns:
the dialect of SQL used to access the remote DBMS

toRel

public RelNode toRel(RelOptCluster cluster,
                     RelOptConnection connection)
Description copied from interface: RelOptTable
Converts this table into a relational expression.

The planner calls this method to convert a table into an initial relational expression, generally something abstract, such as a TableAccessRel, then optimizes this expression by applying rules to transform it into more efficient access methods for this table.

Parameters:
cluster - the cluster the relational expression will belong to
connection - the parse tree of the expression which evaluates to a connection object

optimizeLoopbackLink

private RelNode optimizeLoopbackLink(RelOptCluster cluster,
                                     RelOptConnection connection)
                              throws SQLException
Throws:
SQLException

optimizeLoopbackLink

protected RelNode optimizeLoopbackLink(RelOptCluster cluster,
                                       RelOptConnection connection,
                                       String[] actualName)
                                throws SQLException
Throws:
SQLException