Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
hmottestad committed Nov 6, 2024
1 parent 21b7a85 commit 3193a24
Showing 1 changed file with 8 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public class TargetChainRetriever implements PlanNode {
private final EffectiveTarget.EffectiveTargetFragment rsxTarget;
private final List<StatementMatcher> originalStatementMatchers;

private StackTraceElement[] stackTrace;
private final StackTraceElement[] stackTrace;
private ValidationExecutionLogger validationExecutionLogger;

public TargetChainRetriever(ConnectionsGroup connectionsGroup,
Expand Down Expand Up @@ -330,50 +330,20 @@ private List<BindingSet> readStatementsInBulk(Set<String> variableNames) {
Stream<EffectiveTarget.StatementsAndMatcher> rootStatements = Stream
.of(new EffectiveTarget.StatementsAndMatcher(List.of(next), currentStatementMatcher));
if (removedStatement && removedStatementTarget != null) {
Stream<EffectiveTarget.StatementsAndMatcher> root = null;
Throwable t1 = null;
int failed = 0;
try {
root = removedStatementTarget.getRoot(

if (!statementMatchers.contains(currentStatementMatcher)) {
// we only need to find the root if the currentStatementMatcher doesn't match anything in
// the query
Stream<EffectiveTarget.StatementsAndMatcher> root = removedStatementTarget.getRoot(
connectionsGroup,
dataGraph, currentStatementMatcher,
next);
} catch (Throwable e) {
failed++;
t1 = e;
}

if (failed == 1) {
logger.warn("currentStatementMatcher: " + currentStatementMatcher.toString());
logger.warn("sparqlValuesDecl: " + sparqlValuesDecl);
logger.warn("queryFragment: " + queryFragment);
List<EffectiveTarget.StatementsAndMatcher> collect = rootStatements
.collect(Collectors.toList());
for (EffectiveTarget.StatementsAndMatcher statementsAndMatcher : collect) {
logger.warn(statementsAndMatcher.toString());
}
for (StatementMatcher statementMatcher : statementMatchers) {
logger.warn("statementMatchers: " + statementMatcher.toString());
}
for (StatementMatcher statementMatcher : removedStatementMatchers) {
logger.warn("removedStatementMatchers: " + statementMatcher.toString());
}
for (StatementMatcher statementMatcher : originalStatementMatchers) {
logger.warn("originalStatementMatchers: " + statementMatcher.toString());
if (root != null) {
rootStatements = root;
}

System.err.println("\n");
t1.printStackTrace();
System.err.println("\n");

rootStatements = collect.stream();
System.out.println();
throw new IllegalStateException("Failed to get root for removed statement!", t1);
}

if (root != null) {
rootStatements = root;
}
}

List<EffectiveTarget.StatementsAndMatcher> collect = rootStatements.collect(Collectors.toList());
Expand Down

0 comments on commit 3193a24

Please sign in to comment.