Skip to content

Commit

Permalink
Fixes for failing scheduler tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-weber committed Dec 12, 2024
1 parent 3224ca0 commit 86b9743
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 30 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/polypheny/db/rex/RexLiteral.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,15 @@ private static void printAsJava( PolyValue value, PrintWriter pw, PolyType typeN
pw.print( value.asBoolean().value );
break;
case DECIMAL:
assert value.isBigDecimal();
assert value.isNumber();
pw.print( value.asBigDecimal().value );
break;
case DOUBLE:
assert value.isNumber();
pw.print( Util.toScientificNotation( value.asNumber().BigDecimalValue() ) );
break;
case BIGINT:
assert value.isBigDecimal();
assert value.isNumber();
pw.print( value.asNumber().bigDecimalValue() );
pw.print( 'L' );
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,9 @@ public SqlNode toSql( RexProgram program, RexNode rex ) {
return SqlLiteral.createCharString( literal.value.asString().value, POS );
case NUMERIC:
case EXACT_NUMERIC:
return SqlLiteral.createExactNumeric( literal.value.asBigDecimal().value.toString(), POS );
return SqlLiteral.createExactNumeric( literal.value.asNumber().bigDecimalValue().toString(), POS );
case APPROXIMATE_NUMERIC:
return SqlLiteral.createApproxNumeric( literal.value.asBigDecimal().value.toString(), POS );
return SqlLiteral.createApproxNumeric( literal.value.asNumber().bigDecimalValue().toString(), POS );
case BOOLEAN:
return SqlLiteral.createBoolean( literal.value.asBoolean().value, POS );
case INTERVAL_YEAR_MONTH:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,4 +387,16 @@ public void validateStructure( StorageManager sm, AttributedDirectedGraph<UUID,

}


@Override
public String toString() {
return "WorkflowImpl{" +
"\n activities=" + getActivities() +
", \n edges=" + getEdges() +
", \n config=" + config +
", \n state=" + state +
", \n variables=" + variables +
"\n}";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public String toString() {
", isIgnored=" + isIgnored +
", from=" + from +
", to=" + to +
", edgeState=" + getState() +
'}';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public String toString() {
", toPort=" + toPort +
", from=" + from +
", to=" + to +
", edgeState=" + getState() +
'}';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ private void updateGraph( boolean isSuccess, Set<UUID> activities, UUID rootId,
Edge edge = workflow.getEdge( execEdge );
if ( activities.contains( execEdge.getTarget() ) ) {
edge.setState( isSuccess ? EdgeState.ACTIVE : EdgeState.INACTIVE );
} else {
} else if ( !(isInitialUpdate && edge.getTo().getState() == ActivityState.SAVED) ) { // already saved target activities do not have to be updated again
assert edge.isIgnored() || !edge.getTo().getState().isExecuted() :
"Encountered an activity that was executed before its predecessors: " + edge.getTo();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.jetbrains.annotations.NotNull;
import org.polypheny.db.algebra.AlgNode;
import org.polypheny.db.algebra.AlgRoot;
import org.polypheny.db.algebra.type.AlgDataType;
Expand Down Expand Up @@ -83,13 +82,7 @@ public final Iterator<List<PolyValue>> getIterator() {
* @return An iterable that yields tuples as mutable lists.
*/
public final Iterable<List<PolyValue>> getIterable() {
return new Iterable<>() {
@NotNull
@Override
public Iterator<List<PolyValue>> iterator() {
return getIterator();
}
};
return this::getIterator;
}


Expand Down Expand Up @@ -126,14 +119,7 @@ public Pair<AlgDataType, Iterator<List<PolyValue>>> getIteratorFromQuery( Checkp
*/
public Pair<AlgDataType, Iterable<List<PolyValue>>> getIterableFromQuery( CheckpointQuery query ) {
Pair<AlgDataType, Iterator<List<PolyValue>>> pair = getIteratorFromQuery( query, List.of( this ) );
return Pair.of( pair.left,
new Iterable<>() {
@NotNull
@Override
public Iterator<List<PolyValue>> iterator() {
return pair.right;
}
} );
return Pair.of( pair.left, () -> pair.right );
}


Expand Down Expand Up @@ -204,6 +190,7 @@ public Pair<AlgDataType, Iterator<List<PolyValue>>> getIteratorFromQuery( Checkp
.query( queryStr )
.language( QueryLanguage.from( query.getQueryLanguage() ) )
.isAnalysed( false )
.batch( 100 ) // TODO: ensure this has the desired effect, then change to suitable value
.origin( StorageManager.ORIGIN )
.namespaceId( entity.getNamespaceId() )
.transactionManager( transaction.getTransactionManager() )
Expand Down Expand Up @@ -241,13 +228,7 @@ public Pair<AlgDataType, Iterator<List<PolyValue>>> getIteratorFromQuery( Checkp
public Pair<AlgDataType, Iterable<List<PolyValue>>> getIterableFromQuery( CheckpointQuery query, List<CheckpointReader> inputs ) {
Pair<AlgDataType, Iterator<List<PolyValue>>> pair = getIteratorFromQuery( query, inputs );
return Pair.of( pair.left,
new Iterable<>() {
@NotNull
@Override
public Iterator<List<PolyValue>> iterator() {
return pair.right;
}
} );
() -> pair.right );
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ void executeWorkflowInStepsTest() throws Exception {


@Test
@Disabled
void simpleFusionTest() throws Exception {
Workflow workflow = WorkflowUtils.getSimpleFusion();
List<UUID> ids = WorkflowUtils.getTopologicalActivityIds( workflow );
Expand Down Expand Up @@ -161,7 +160,6 @@ void advancedFusionTest() throws Exception {


@Test
@Disabled
void RelValuesFusionTest() throws Exception {
Workflow workflow = WorkflowUtils.getRelValuesFusion();
List<UUID> ids = WorkflowUtils.getTopologicalActivityIds( workflow );
Expand Down

0 comments on commit 86b9743

Please sign in to comment.