protected RelNode optimizeLoopbackLink( RelOptCluster cluster, RelOptConnection connection, String[] actualName) throws SQLException { if (directory == null) { return null; } if (directory.server == null) { return null; } if ((directory.server.schemaName != null) && !directory.server.useSchemaNameAsForeignQualifier) { // Schema name should never be specified for a connection to // Farrago; if it is, bail. return null; } Connection loopbackConnection = directory.server.getConnection(); if (!(loopbackConnection instanceof FarragoJdbcEngineConnection)) { Connection conn = loopbackConnection; while ((conn != null) && (conn instanceof DelegatingConnection)) { conn = ((DelegatingConnection) conn).getDelegate(); } if (!(conn instanceof FarragoJdbcEngineConnection)) { return null; } } String catalogName = directory.server.catalogName; if (catalogName == null) { // No catalog name specified, so try to query the connection for // it. catalogName = loopbackConnection.getCatalog(); if (catalogName == null) { return null; } } if (actualName[0] == null) { actualName[0] = catalogName; } // REVIEW jvs 14-Aug-2006: Security security security. RelOptTable realTable = getPreparingStmt().getTableForMember(actualName); if (realTable == null) { return null; } return realTable.toRel(cluster, connection); }
// override Object public boolean equals(Object obj) { if (!(obj instanceof RelColumnOrigin)) { return false; } RelColumnOrigin other = (RelColumnOrigin) obj; return Arrays.equals(originTable.getQualifiedName(), other.originTable.getQualifiedName()) && (iOriginColumn == other.iOriginColumn) && (isDerived == other.isDerived); }
// override Object public int hashCode() { return Arrays.hashCode(originTable.getQualifiedName()) + iOriginColumn + (isDerived ? 313 : 0); }
public boolean isKey(BitSet columns) { return parent.isKey(columns); }
public List<RelCollation> getCollationList() { return parent.getCollationList(); }
public RelOptSchema getRelOptSchema() { return parent.getRelOptSchema(); }
public RelDataType getRowType() { return parent.getRowType(); }
public double getRowCount() { return parent.getRowCount(); }
public List<String> getQualifiedName() { return parent.getQualifiedName(); }
public Expression getExpression(Class clazz) { return parent.getExpression(clazz); }
public <T> T unwrap(Class<T> clazz) { if (clazz.isInstance(this)) { return clazz.cast(this); } return parent.unwrap(clazz); }