Skip to content

Commit

Permalink
removing unused classes
Browse files Browse the repository at this point in the history
  • Loading branch information
datomo committed Nov 21, 2023
1 parent 52040cf commit 0b22e1e
Show file tree
Hide file tree
Showing 26 changed files with 63 additions and 493 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
import org.polypheny.db.languages.OperatorRegistry;
import org.polypheny.db.nodes.Operator;
import org.polypheny.db.plan.AlgOptCluster;
import org.polypheny.db.plan.AlgOptEntity.ToAlgContext;
import org.polypheny.db.rex.RexBuilder;
import org.polypheny.db.rex.RexCall;
import org.polypheny.db.rex.RexCorrelVariable;
Expand Down Expand Up @@ -173,17 +172,17 @@ public class AlgStructuredTypeFlattener implements ReflectiveVisitor {
private int iRestructureInput;
private AlgDataType flattenedRootType;
boolean restructured;
private final ToAlgContext toAlgContext;
private final AlgOptCluster cluster;


public AlgStructuredTypeFlattener(
AlgBuilder algBuilder,
RexBuilder rexBuilder,
ToAlgContext toAlgContext,
AlgOptCluster cluster,
boolean restructure ) {
this.algBuilder = algBuilder;
this.rexBuilder = rexBuilder;
this.toAlgContext = toAlgContext;
this.cluster = cluster;
this.restructure = restructure;
}

Expand Down Expand Up @@ -456,7 +455,7 @@ public void rewriteAlg( LogicalDocumentSort alg ) {
public void rewriteAlg( LogicalDocumentScan scan ) {
AlgNode alg = scan;
if ( scan.entity.isPhysical() ) {
alg = scan.entity.unwrap( TranslatableEntity.class ).toAlg( toAlgContext, scan.traitSet );
alg = scan.entity.unwrap( TranslatableEntity.class ).toAlg( cluster, scan.traitSet );
}
setNewForOldAlg( scan, alg );
}
Expand Down Expand Up @@ -489,7 +488,7 @@ public void rewriteAlg( LogicalLpgModify alg ) {
public void rewriteAlg( LogicalLpgScan scan ) {
AlgNode alg = scan;
if ( scan.entity.isPhysical() ) {
alg = scan.entity.unwrap( TranslatableEntity.class ).toAlg( toAlgContext, scan.traitSet );
alg = scan.entity.unwrap( TranslatableEntity.class ).toAlg( cluster, scan.traitSet );
}
setNewForOldAlg( scan, alg );
}
Expand Down Expand Up @@ -874,7 +873,7 @@ public void rewriteAlg( LogicalRelScan alg ) {
rewriteGeneric( alg );
return;
}
AlgNode newAlg = alg.entity.unwrap( TranslatableEntity.class ).toAlg( toAlgContext, alg.traitSet );
AlgNode newAlg = alg.entity.unwrap( TranslatableEntity.class ).toAlg( cluster, alg.traitSet );
if ( !PolyTypeUtil.isFlat( alg.getRowType() ) ) {
final List<Pair<RexNode, String>> flattenedExpList = new ArrayList<>();
flattenInputs(
Expand Down Expand Up @@ -1058,7 +1057,7 @@ public RexNode visitCall( RexCall rexCall ) {
@Override
public RexNode visitSubQuery( RexSubQuery subQuery ) {
subQuery = (RexSubQuery) super.visitSubQuery( subQuery );
AlgStructuredTypeFlattener flattener = new AlgStructuredTypeFlattener( algBuilder, rexBuilder, toAlgContext, restructure );
AlgStructuredTypeFlattener flattener = new AlgStructuredTypeFlattener( algBuilder, rexBuilder, cluster, restructure );
AlgNode alg = flattener.rewrite( subQuery.alg );
return subQuery.clone( alg );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
import org.polypheny.db.catalog.entity.LogicalEntity;
import org.polypheny.db.catalog.logistic.EntityType;
import org.polypheny.db.plan.AlgOptCluster;
import org.polypheny.db.plan.AlgOptEntity.ToAlgContext;
import org.polypheny.db.plan.Contexts;
import org.polypheny.db.rex.RexLiteral;
import org.polypheny.db.rex.RexNode;
Expand Down Expand Up @@ -572,8 +571,7 @@ public static ScanFactory expandingScanFactory( @Nonnull ScanFactory scanFactory
return ( cluster, entity ) -> {
final TranslatableEntity translatableTable = entity.unwrap( TranslatableEntity.class );
if ( translatableTable != null ) {
final ToAlgContext toAlgContext = () -> cluster;
return translatableTable.toAlg( toAlgContext, cluster.traitSet() );
return translatableTable.toAlg( cluster, cluster.traitSet() );
}
return scanFactory.createScan( cluster, entity );
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ private SemiJoin findSemiJoinIndexByCost( LoptMultiJoin multiJoin, List<RexNode>
factIdx,
dimIdx );

AlgNode factRel = multiJoin.getJoinFactor( factIdx );
AlgNode factAlg = multiJoin.getJoinFactor( factIdx );
AlgNode dimRel = multiJoin.getJoinFactor( dimIdx );
final JoinInfo joinInfo = JoinInfo.of( factRel, dimRel, semiJoinCondition );
final JoinInfo joinInfo = JoinInfo.of( factAlg, dimRel, semiJoinCondition );
assert joinInfo.leftKeys.size() > 0;

// mutable copies
Expand All @@ -239,14 +239,14 @@ private SemiJoin findSemiJoinIndexByCost( LoptMultiJoin multiJoin, List<RexNode>

// Make sure all the fact table keys originate from the same table and are simple column references
final List<Integer> actualLeftKeys = new ArrayList<>();
LcsEntity factTable = validateKeys( factRel, leftKeys, rightKeys, actualLeftKeys );
LcsEntity factTable = validateKeys( factAlg, leftKeys, rightKeys, actualLeftKeys );
if ( factTable == null ) {
return null;
}

// Find the best index
final List<Integer> bestKeyOrder = new ArrayList<>();
LcsScan tmpFactRel = (LcsScan) factTable.unwrap( TranslatableEntity.class ).toAlg( factRel::getCluster, factRel.getTraitSet() );
LcsScan tmpFactRel = (LcsScan) factTable.unwrap( TranslatableEntity.class ).toAlg( factAlg.getCluster(), factAlg.getTraitSet() );

LcsIndexOptimizer indexOptimizer = new LcsIndexOptimizer( tmpFactRel );
FemLocalIndex bestIndex =
Expand Down Expand Up @@ -281,7 +281,7 @@ private SemiJoin findSemiJoinIndexByCost( LoptMultiJoin multiJoin, List<RexNode>
semiJoinCondition );
}
return SemiJoin.create(
factRel,
factAlg,
dimRel,
semiJoinCondition,
ImmutableList.copyOf( truncatedLeftKeys ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.polypheny.db.algebra.AlgNode;
import org.polypheny.db.algebra.core.AlgFactories;
import org.polypheny.db.algebra.logical.relational.LogicalRelScan;
import org.polypheny.db.plan.AlgOptEntity.ToAlgContext;
import org.polypheny.db.plan.AlgOptRule;
import org.polypheny.db.plan.AlgOptRuleCall;
import org.polypheny.db.plan.AlgTraitSet;
Expand All @@ -29,7 +28,7 @@


/**
* Planner rule that converts a {@link LogicalRelScan} to the result of calling {@link TranslatableEntity#toAlg(ToAlgContext, AlgTraitSet)}.
* Planner rule that converts a {@link LogicalRelScan} to the result of calling {@link TranslatableEntity#toAlg(org.polypheny.db.plan.AlgOptCluster, AlgTraitSet)}.
*/
public class ScanRule extends AlgOptRule {

Expand All @@ -52,7 +51,7 @@ public void onMatch( AlgOptRuleCall call ) {
if ( oldAlg.getEntity().unwrap( TranslatableEntity.class ) == null ) {
return;
}
AlgNode newAlg = oldAlg.getEntity().unwrap( TranslatableEntity.class ).toAlg( oldAlg::getCluster, oldAlg.getTraitSet() );
AlgNode newAlg = oldAlg.getEntity().unwrap( TranslatableEntity.class ).toAlg( oldAlg.getCluster(), oldAlg.getTraitSet() );
call.transformTo( newAlg );
}

Expand Down
Loading

0 comments on commit 0b22e1e

Please sign in to comment.