public static int getPreOpsOutputSize(Component component, Schema schema,
	    TableAliasName tan) {
	if (component instanceof ThetaJoinComponent)
	    throw new RuntimeException(
		    "SQL generator with Theta does not work for now!");
	// TODO similar to Equijoin, but not subtracting joinColumnsLength
	final Component[] parents = component.getParents();
	if (parents == null)
	    // this is a DataSourceComponent
	    return getPreOpsOutputSize((DataSourceComponent) component, schema,
		    tan);
	else if (parents.length == 1)
	    return getPreOpsOutputSize(parents[0], schema, tan);
	else if (parents.length == 2) {
	    final Component firstParent = parents[0];
	    final Component secondParent = parents[1];
	    final int joinColumnsLength = firstParent.getHashIndexes().size();
	    return getPreOpsOutputSize(firstParent, schema, tan)
		    + getPreOpsOutputSize(secondParent, schema, tan)
		    - joinColumnsLength;
	}
	throw new RuntimeException("More than two parents for a component "
		+ component);
    }
public static int getPreOpsOutputSize(Component component, Schema schema,
	    TableAliasName tan) {
	if (component instanceof ThetaJoinComponent)
	    throw new RuntimeException(
		    "SQL generator with Theta does not work for now!");

	final Component[] parents = component.getParents();
	if (parents == null)
	   
	    return getPreOpsOutputSize((DataSourceComponent) component, schema,
		    tan);
	else if (parents.length == 1)
	    return getPreOpsOutputSize(parents[0], schema, tan);
	else if (parents.length == 2) {
	    final Component firstParent = parents[0];
	    final Component secondParent = parents[1];
	    final int joinColumnsLength = firstParent.getHashIndexes().size();
	    return getPreOpsOutputSize(firstParent, schema, tan)
		    + getPreOpsOutputSize(secondParent, schema, tan)
		    - joinColumnsLength;
	}
	throw new RuntimeException("More than two parents for a component "
		+ component);
    }
public static int getpreopsoutputsize(component component, schema schema, tablealiasname tan) { if (component instanceof thetajoincomponent) throw new runtimeexception( "sql generator with theta does not work for now!"); final component[] parents = component.getparents(); if (parents == null) return getpreopsoutputsize((datasourcecomponent) component, schema, tan); else if (parents.length == 1) return getpreopsoutputsize(parents[0], schema, tan); else if (parents.length == 2) { final component firstparent = parents[0]; final component secondparent = parents[1]; final int joincolumnslength = firstparent.gethashindexes().size(); return getpreopsoutputsize(firstparent, schema, tan) + getpreopsoutputsize(secondparent, schema, tan) - joincolumnslength; } throw new runtimeexception("more than two parents for a component " + component); }