Skip to content

Commit

Permalink
removing old catalogReader inheritant classes and old tests
Browse files Browse the repository at this point in the history
  • Loading branch information
datomo committed Nov 26, 2023
1 parent 5f7cfa8 commit b57570b
Show file tree
Hide file tree
Showing 50 changed files with 189 additions and 3,043 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.polypheny.db.algebra.core.common.Modify.Operation;
import org.polypheny.db.catalog.entity.LogicalEntity;
import org.polypheny.db.catalog.snapshot.Snapshot;
import org.polypheny.db.prepare.Prepare.CatalogReader;
import org.polypheny.db.schema.types.ModifiableTable;


Expand All @@ -31,10 +30,6 @@
*/
public interface RelationalTransformable {

default CatalogReader getCatalogReader() {
throw new UnsupportedOperationException();
}


List<AlgNode> getRelationalEquivalent( List<AlgNode> values, List<LogicalEntity> entities, Snapshot snapshot );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import org.polypheny.db.algebra.constant.Kind;
import org.polypheny.db.nodes.Function;
import org.polypheny.db.schema.Wrapper;
import org.polypheny.db.util.Wrapper;

public interface AggFunction extends Function, Wrapper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.polypheny.db.catalog.impl.allocation.PolyAllocDocCatalog;
import org.polypheny.db.catalog.impl.allocation.PolyAllocGraphCatalog;
import org.polypheny.db.catalog.impl.allocation.PolyAllocRelCatalog;
import org.polypheny.db.schema.Wrapper;
import org.polypheny.db.util.Wrapper;

@SerializeClass(subclasses = { PolyAllocDocCatalog.class, PolyAllocGraphCatalog.class, PolyAllocRelCatalog.class })
public interface AllocationCatalog extends Wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
import org.polypheny.db.catalog.refactor.CatalogType;
import org.polypheny.db.schema.Statistic;
import org.polypheny.db.schema.Statistics;
import org.polypheny.db.schema.Wrapper;
import org.polypheny.db.schema.types.Expressible;
import org.polypheny.db.schema.types.Typed;
import org.polypheny.db.util.ImmutableBitSet;
import org.polypheny.db.util.Wrapper;

@Getter
@SuperBuilder(toBuilder = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ static ConfigBuilder configBuilder() {
return new ConfigBuilder();
}

void setDynamicParamCountInExplain( int explainParamCount );

AlgNode flattenTypes( AlgNode rootAlg, boolean restructure );

AlgNode decorrelate( Node query, AlgNode rootAlg );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import org.polypheny.db.catalog.entity.logical.LogicalTable;
import org.polypheny.db.catalog.snapshot.Snapshot;
import org.polypheny.db.nodes.Identifier;
import org.polypheny.db.schema.Wrapper;
import org.polypheny.db.util.Moniker;
import org.polypheny.db.util.Wrapper;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.polypheny.db.algebra.constant.Monotonicity;
import org.polypheny.db.algebra.type.AlgDataType;
import org.polypheny.db.catalog.entity.logical.LogicalTable;
import org.polypheny.db.schema.Wrapper;
import org.polypheny.db.util.Wrapper;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
/**
* Abstract base for implementations of the {@link AlgOptPlanner} interface.
*/
public abstract class AbstractRelOptPlanner implements AlgOptPlanner {
public abstract class AbstractAlgOptPlanner implements AlgOptPlanner {

/**
* Regular expression for integer.
Expand Down Expand Up @@ -95,7 +95,7 @@ public abstract class AbstractRelOptPlanner implements AlgOptPlanner {
/**
* Creates an AbstractRelOptPlanner.
*/
protected AbstractRelOptPlanner( AlgOptCostFactory costFactory, Context context ) {
protected AbstractAlgOptPlanner( AlgOptCostFactory costFactory, Context context ) {
assert costFactory != null;
this.costFactory = costFactory;
if ( context == null ) {
Expand Down
111 changes: 0 additions & 111 deletions core/src/main/java/org/polypheny/db/plan/AlgOptEntity.java

This file was deleted.

29 changes: 3 additions & 26 deletions core/src/main/java/org/polypheny/db/plan/AlgOptQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,53 +37,30 @@
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.polypheny.db.algebra.AlgNode;
import org.polypheny.db.algebra.core.CorrelationId;


/**
* A <code>AlgOptQuery</code> represents a set of {@link AlgNode relational expressions} which derive from the same <code>select</code> statement.
*/
public class AlgOptQuery {

/**
* Prefix to the name of correlating variables.
*/
public static final String CORREL_PREFIX = CorrelationId.CORREL_PREFIX;


/**
* Maps name of correlating variable (e.g. "$cor3") to the {@link AlgNode} which implements it.
*/
final Map<String, AlgNode> mapCorrelToRel;
final Map<String, AlgNode> mapCorrelToAlg;

private final AlgOptPlanner planner;
final AtomicInteger nextCorrel;


/**
* For use by RelOptCluster only.
*/
AlgOptQuery( AlgOptPlanner planner, AtomicInteger nextCorrel, Map<String, AlgNode> mapCorrelToRel ) {
this.planner = planner;
AlgOptQuery( AtomicInteger nextCorrel, Map<String, AlgNode> mapCorrelToAlg ) {
this.nextCorrel = nextCorrel;
this.mapCorrelToRel = mapCorrelToRel;
}


/**
* Returns the relational expression which populates a correlating variable.
*/
public AlgNode lookupCorrel( String name ) {
return mapCorrelToRel.get( name );
this.mapCorrelToAlg = mapCorrelToAlg;
}


/**
* Maps a correlating variable to a {@link AlgNode}.
*/
public void mapCorrel( String name, AlgNode alg ) {
mapCorrelToRel.put( name, alg );
}

}

17 changes: 1 addition & 16 deletions core/src/main/java/org/polypheny/db/plan/AlgOptSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,9 @@
package org.polypheny.db.plan;


import java.util.List;
import org.polypheny.db.catalog.entity.logical.LogicalTable;


/**
* A <code>RelOptSchema</code> is a set of {@link AlgOptEntity} objects.
* A <code>RelOptSchema</code> is a set of objects.
*/
public interface AlgOptSchema {

/**
* Retrieves a {@link AlgOptEntity} based upon a member access.
*
* For example, the Saffron expression <code>salesSchema.emps</code> would be resolved using a call to <code>salesSchema.getTableForMember(new String[]{"emps" })</code>.
*
* Note that name.length is only greater than 1 for queries originating from JDBC.
*
* @param names Qualified name
*/
LogicalTable getTableForMember( List<String> names );

}
2 changes: 1 addition & 1 deletion core/src/main/java/org/polypheny/db/plan/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
package org.polypheny.db.plan;


import org.polypheny.db.schema.Wrapper;
import org.polypheny.db.util.Wrapper;


/**
Expand Down
12 changes: 6 additions & 6 deletions core/src/main/java/org/polypheny/db/plan/hep/HepPlanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import org.polypheny.db.algebra.core.AlgFactories;
import org.polypheny.db.algebra.metadata.AlgMetadataProvider;
import org.polypheny.db.algebra.metadata.AlgMetadataQuery;
import org.polypheny.db.plan.AbstractRelOptPlanner;
import org.polypheny.db.plan.AbstractAlgOptPlanner;
import org.polypheny.db.plan.AlgOptCost;
import org.polypheny.db.plan.AlgOptCostFactory;
import org.polypheny.db.plan.AlgOptCostImpl;
Expand All @@ -81,7 +81,7 @@
/**
* HepPlanner is a heuristic implementation of the {@link AlgOptPlanner} interface.
*/
public class HepPlanner extends AbstractRelOptPlanner {
public class HepPlanner extends AbstractAlgOptPlanner {

private final HepProgram mainProgram;

Expand Down Expand Up @@ -151,7 +151,7 @@ public HepPlanner( HepProgram program, Context context, boolean noDag, Function2
// implement RelOptPlanner
@Override
public void setRoot( AlgNode alg ) {
root = addRelToGraph( alg );
root = addAlgToGraph( alg );
dumpGraph();
}

Expand Down Expand Up @@ -686,7 +686,7 @@ private HepAlgVertex applyTransformationResults( HepAlgVertex vertex, HepRuleCal
parents.add( parent );
}

HepAlgVertex newVertex = addRelToGraph( bestRel );
HepAlgVertex newVertex = addAlgToGraph( bestRel );

// There's a chance that newVertex is the same as one of the parents due to common subexpression recognition (e.g. the LogicalProject added by JoinCommuteRule). In that
// case, treat the transformation as a nop to avoid creating a loop.
Expand Down Expand Up @@ -734,7 +734,7 @@ public boolean isRegistered( AlgNode alg ) {
}


private HepAlgVertex addRelToGraph( AlgNode alg ) {
private HepAlgVertex addAlgToGraph( AlgNode alg ) {
// Check if a transformation already produced a reference to an existing vertex.
if ( graph.vertexSet().contains( alg ) ) {
return (HepAlgVertex) alg;
Expand All @@ -744,7 +744,7 @@ private HepAlgVertex addRelToGraph( AlgNode alg ) {
final List<AlgNode> inputs = alg.getInputs();
final List<AlgNode> newInputs = new ArrayList<>();
for ( AlgNode input1 : inputs ) {
HepAlgVertex childVertex = addRelToGraph( input1 );
HepAlgVertex childVertex = addAlgToGraph( input1 );
newInputs.add( childVertex );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
import org.polypheny.db.algebra.rules.UnionToDistinctRule;
import org.polypheny.db.catalog.exceptions.GenericRuntimeException;
import org.polypheny.db.config.RuntimeConfig;
import org.polypheny.db.plan.AbstractRelOptPlanner;
import org.polypheny.db.plan.AbstractAlgOptPlanner;
import org.polypheny.db.plan.AlgOptCost;
import org.polypheny.db.plan.AlgOptCostFactory;
import org.polypheny.db.plan.AlgOptListener;
Expand All @@ -108,7 +108,7 @@
* VolcanoPlanner optimizes queries by transforming expressions selectively according to a dynamic programming algorithm.
*/
@Slf4j
public class VolcanoPlanner extends AbstractRelOptPlanner {
public class VolcanoPlanner extends AbstractAlgOptPlanner {

protected static final double COST_IMPROVEMENT = .5;

Expand Down
Loading

0 comments on commit b57570b

Please sign in to comment.