// this is a DataSourceComponent
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);
    }
final Component[] parents = component.getParents();
if (parents == null)
// this is a DataSourceComponent
return getPreOpsOutputSize((DataSourceComponent) component, schema,
tan);
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)
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);
}