net.sf.farrago.namespace.impl
Class MedAbstractColumnSet

java.lang.Object
  extended by org.eigenbase.relopt.RelOptAbstractTable
      extended by net.sf.farrago.namespace.impl.MedAbstractColumnSet
All Implemented Interfaces:
FarragoMedColumnSet, FarragoQueryColumnSet, RelOptTable, SqlValidatorTable
Direct Known Subclasses:
FlatFileColumnSet, FtrsTable, LcsTable, MedJdbcColumnSet, MedMdrClassExtent, MedMockColumnSet, MedMqlColumnSet

public abstract class MedAbstractColumnSet
extends RelOptAbstractTable
implements FarragoQueryColumnSet

MedAbstractColumnSet is an abstract base class for implementations of the FarragoMedColumnSet interface.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/namespace/impl/MedAbstractColumnSet.java#28 $
Author:
John V. Sichi

Field Summary
private  SqlAccessType allowedAccess
           
private  Map<String,Properties> columnPropMap
           
private  CwmNamedColumnSet cwmColumnSet
           
private  String[] foreignName
           
private  String[] localName
           
private  FarragoPreparingStmt preparingStmt
           
private  Properties tableProps
           
 
Fields inherited from class org.eigenbase.relopt.RelOptAbstractTable
name, rowType, schema
 
Constructor Summary
protected MedAbstractColumnSet(String[] localName, String[] foreignName, RelDataType rowType, Properties tableProps, Map<String,Properties> columnPropMap)
          Creates a new MedAbstractColumnSet.
 
Method Summary
 SqlAccessType getAllowedAccess()
          Returns the access type of the table
 Map<String,Properties> getColumnPropertyMap()
           
 CwmNamedColumnSet getCwmColumnSet()
           
 String[] getForeignName()
           
 String[] getLocalName()
           
 SqlMonotonicity getMonotonicity(String columnName)
          Returns whether a given column is monotonic.
 FarragoPreparingStmt getPreparingStmt()
           
 String[] getQualifiedName()
          Obtains an identifier for this table.
 Properties getTableProperties()
           
 void setAllowedAccess(SqlAccessType allowedAccess)
           
 void setCwmColumnSet(CwmNamedColumnSet cwmColumnSet)
          Sets the CwmNamedColumnSet corresponding to this column set.
 void setPreparingStmt(FarragoPreparingStmt stmt)
          Sets the FarragoPreparingStmt acting on this column set.
protected  RelNode toLenientRel(RelOptCluster cluster, RelNode child, RelDataType targetRowType, RelDataType srcRowType)
          Converts one RelNode to another RelNode with specified RowType.
protected  RelNode toUdxRel(RelOptCluster cluster, RelOptConnection connection, String udxSpecificName, String serverMofId, RexNode[] args)
          Provides an implementation of the toRel interface method in terms of an underlying UDX.
 
Methods inherited from class org.eigenbase.relopt.RelOptAbstractTable
getCollationList, getName, getRelOptSchema, getRowCount, 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, getRowCount, getRowType, toRel
 
Methods inherited from interface org.eigenbase.sql.validate.SqlValidatorTable
getRowType
 

Field Detail

localName

private final String[] localName

foreignName

private final String[] foreignName

tableProps

private Properties tableProps

columnPropMap

private Map<String,Properties> columnPropMap

preparingStmt

private FarragoPreparingStmt preparingStmt

cwmColumnSet

private CwmNamedColumnSet cwmColumnSet

allowedAccess

private SqlAccessType allowedAccess
Constructor Detail

MedAbstractColumnSet

protected MedAbstractColumnSet(String[] localName,
                               String[] foreignName,
                               RelDataType rowType,
                               Properties tableProps,
                               Map<String,Properties> columnPropMap)
Creates a new MedAbstractColumnSet.

Parameters:
localName - name of this ColumnSet as it will be known within the Farrago system
foreignName - name of this ColumnSet as it is known on the foreign server; may be null if no meaningful name exists
rowType - row type descriptor
tableProps - table-level properties
columnPropMap - column-level properties (map from column name to Properties object)
Method Detail

getQualifiedName

public String[] getQualifiedName()
Description copied from interface: RelOptTable
Obtains an identifier for this table. The identifier must be unique with respect to the Connection producing this table.

Specified by:
getQualifiedName in interface RelOptTable
Specified by:
getQualifiedName in interface SqlValidatorTable
Overrides:
getQualifiedName in class RelOptAbstractTable
Returns:
qualified name

getLocalName

public String[] getLocalName()
Returns:
the name this ColumnSet is known by within the Farrago system

getForeignName

public String[] getForeignName()
Returns:
the name of this ColumnSet as it is known on the foreign server

getTableProperties

public Properties getTableProperties()
Returns:
options specified by CREATE FOREIGN TABLE

getColumnPropertyMap

public Map<String,Properties> getColumnPropertyMap()
Returns:
map (from column name to Properties) of column options specified by CREATE FOREIGN TABLE

getPreparingStmt

public FarragoPreparingStmt getPreparingStmt()
Specified by:
getPreparingStmt in interface FarragoQueryColumnSet
Returns:
the FarragoPreparingStmt acting on this column set

setPreparingStmt

public void setPreparingStmt(FarragoPreparingStmt stmt)
Description copied from interface: FarragoQueryColumnSet
Sets the FarragoPreparingStmt acting on this column set.

Specified by:
setPreparingStmt in interface FarragoQueryColumnSet
Parameters:
stmt - the FarragoPreparingStmt to set

setCwmColumnSet

public void setCwmColumnSet(CwmNamedColumnSet cwmColumnSet)
Description copied from interface: FarragoQueryColumnSet
Sets the CwmNamedColumnSet corresponding to this column set.

Specified by:
setCwmColumnSet in interface FarragoQueryColumnSet
Parameters:
cwmColumnSet - the CwmNamedColumnSet, or null if this column set is not defined in the catalog

getCwmColumnSet

public CwmNamedColumnSet getCwmColumnSet()
Specified by:
getCwmColumnSet in interface FarragoQueryColumnSet
Returns:
the CwmNamedColumnSet corresponding to this column set

getMonotonicity

public SqlMonotonicity getMonotonicity(String columnName)
Description copied from interface: SqlValidatorTable
Returns whether a given column is monotonic.

Specified by:
getMonotonicity in interface SqlValidatorTable

getAllowedAccess

public SqlAccessType getAllowedAccess()
Description copied from interface: SqlValidatorTable
Returns the access type of the table

Specified by:
getAllowedAccess in interface SqlValidatorTable

setAllowedAccess

public void setAllowedAccess(SqlAccessType allowedAccess)

toUdxRel

protected RelNode toUdxRel(RelOptCluster cluster,
                           RelOptConnection connection,
                           String udxSpecificName,
                           String serverMofId,
                           RexNode[] args)
Provides an implementation of the toRel interface method in terms of an underlying UDX.

Parameters:
cluster - same as for toRel
connection - same as for toRel
udxSpecificName - specific name with which the UDX was created (either via the SPECIFIC keyword or the invocation name if SPECIFIC was not specified); this can be a qualified name, possibly with quoted identifiers, e.g. x.y.z or x."y".z
serverMofId - if not null, the invoked UDX can access the data server with the given MOFID at runtime via FarragoUdrRuntime.getDataServerRuntimeSupport(java.lang.Object)
args - arguments to UDX invocation
Returns:
generated relational expression producing the UDX results

toLenientRel

protected RelNode toLenientRel(RelOptCluster cluster,
                               RelNode child,
                               RelDataType targetRowType,
                               RelDataType srcRowType)
Converts one RelNode to another RelNode with specified RowType. New columns are filled with nulls.

Parameters:
cluster - same as for toRel
child - original RelNode
targetRowType - RowType to map to
srcRowType - RowType of external data source