Skip to content

Commit

Permalink
Modify stream to insert ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Hafner committed Dec 14, 2024
1 parent 1c9ae77 commit d7d633b
Show file tree
Hide file tree
Showing 17 changed files with 99 additions and 285 deletions.
3 changes: 0 additions & 3 deletions core/src/main/java/org/polypheny/db/algebra/AlgShuttle.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import org.polypheny.db.algebra.logical.relational.LogicalRelCorrelate;
import org.polypheny.db.algebra.logical.relational.LogicalRelExchange;
import org.polypheny.db.algebra.logical.relational.LogicalRelFilter;
import org.polypheny.db.algebra.logical.relational.LogicalRelIdentifierInjection;
import org.polypheny.db.algebra.logical.relational.LogicalRelIntersect;
import org.polypheny.db.algebra.logical.relational.LogicalRelJoin;
import org.polypheny.db.algebra.logical.relational.LogicalRelMatch;
Expand Down Expand Up @@ -107,8 +106,6 @@ public interface AlgShuttle {

AlgNode visit( LogicalRelModify modify );

AlgNode visit( LogicalRelIdentifierInjection idInjection );

AlgNode visit( LogicalConditionalExecute lce );

AlgNode visit( LogicalLpgModify modify );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
import org.polypheny.db.algebra.logical.relational.LogicalRelCorrelate;
import org.polypheny.db.algebra.logical.relational.LogicalRelExchange;
import org.polypheny.db.algebra.logical.relational.LogicalRelFilter;
import org.polypheny.db.algebra.logical.relational.LogicalRelIdentifierInjection;
import org.polypheny.db.algebra.logical.relational.LogicalRelIntersect;
import org.polypheny.db.algebra.logical.relational.LogicalRelJoin;
import org.polypheny.db.algebra.logical.relational.LogicalRelMatch;
Expand Down Expand Up @@ -211,12 +210,6 @@ public AlgNode visit( LogicalRelModify modify ) {
}


@Override
public AlgNode visit( LogicalRelIdentifierInjection idInjection ) {
return visitChildren( idInjection );
}


@Override
public AlgNode visit( LogicalConstraintEnforcer enforcer ) {
return visitChildren( enforcer );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
import org.polypheny.db.algebra.logical.relational.LogicalRelAggregate;
import org.polypheny.db.algebra.logical.relational.LogicalRelCorrelate;
import org.polypheny.db.algebra.logical.relational.LogicalRelFilter;
import org.polypheny.db.algebra.logical.relational.LogicalRelIdentifierInjection;
import org.polypheny.db.algebra.logical.relational.LogicalRelIntersect;
import org.polypheny.db.algebra.logical.relational.LogicalRelJoin;
import org.polypheny.db.algebra.logical.relational.LogicalRelMatch;
Expand Down Expand Up @@ -180,7 +179,6 @@ public class AlgStructuredTypeFlattener implements AlgConsumingVisitor {
private ImmutableMap<Class<? extends AlgNode>, Consumer<AlgNode>> handlers = ImmutableMap.copyOf(
new HashMap<>() {{
put( LogicalRelModify.class, a -> rewriteAlg( (LogicalRelModify) a ) );
put( LogicalRelIdentifierInjection.class, a -> rewriteAlg( (LogicalRelIdentifierInjection) a ) );
put( LogicalRelScan.class, a -> rewriteAlg( (LogicalRelScan) a ) );
put( LogicalRelTableFunctionScan.class, a -> rewriteAlg( (LogicalRelTableFunctionScan) a ) );
put( LogicalRelValues.class, a -> rewriteAlg( (LogicalRelValues) a ) );
Expand Down Expand Up @@ -578,16 +576,6 @@ public void rewriteAlg( LogicalRelModify alg ) {
}


public void rewriteAlg( LogicalRelIdentifierInjection alg ) {
LogicalRelIdentifierInjection newAlg =
LogicalRelIdentifierInjection.create(
alg.getEntity(),
getNewForOldRel( alg.getLeft() ),
getNewForOldRel( alg.getRight() ));
setNewForOldAlg( alg, newAlg );
}


public void rewriteAlg( LogicalRelAggregate alg ) {
AlgDataType inputType = alg.getInput().getTupleType();
for ( AlgDataTypeField field : inputType.getFields() ) {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ public class EnumerableRules {
private EnumerableRules() {
}

public static final EnumerableIdentifierInjectionRule ENUMERABLE_IDENTIFIER_INJECTION_RULE = new EnumerableIdentifierInjectionRule();

public static final EnumerableConditionalExecuteRule ENUMERABLE_CONDITIONAL_EXECUTE_RULE = new EnumerableConditionalExecuteRule();

public static final EnumerableConditionalExecuteTrueRule ENUMERABLE_CONDITIONAL_EXECUTE_TRUE_RULE = new EnumerableConditionalExecuteTrueRule();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public AlgDataTypeFieldImpl( Long id, String name, String physicalName, int inde
this.physicalName = physicalName;
}


@Override
public int hashCode() {
return index ^ name.hashCode() ^ type.hashCode();
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/java/org/polypheny/db/functions/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@
import org.polypheny.db.interpreter.Row;
import org.polypheny.db.runtime.ComparableList;
import org.polypheny.db.runtime.Like;
import org.polypheny.db.transaction.locking.IdentifierRegistry;
import org.polypheny.db.transaction.locking.IdentifierUtils;
import org.polypheny.db.type.PolyType;
import org.polypheny.db.type.PolyTypeFactoryImpl;
import org.polypheny.db.type.entity.PolyBinary;
Expand Down Expand Up @@ -347,6 +349,8 @@ private static Enumerable<PolyValue[]> handleContextBatch(

List<PolyValue[]> values = new ArrayList<>();
for ( PolyValue[] o : baz ) {
// ToDo TH: naive proof of concept for identifier injection
o[0] = IdentifierUtils.getIdentifierAsPolyLong();
values.add( o );
}
if ( values.isEmpty() ) {
Expand Down
1 change: 0 additions & 1 deletion core/src/main/java/org/polypheny/db/tools/Programs.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ public class Programs {

public static final ImmutableSet<AlgOptRule> RULE_SET =
ImmutableSet.of(
EnumerableRules.ENUMERABLE_IDENTIFIER_INJECTION_RULE,
EnumerableRules.ENUMERABLE_JOIN_RULE,
EnumerableRules.ENUMERABLE_MERGE_JOIN_RULE,
EnumerableRules.ENUMERABLE_SEMI_JOIN_RULE,
Expand Down
Loading

0 comments on commit d7d633b

Please sign in to comment.