Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Generator rejected this profile with IllegalStateException #1520

Closed
leeyuiwah-sl opened this issue Nov 5, 2019 · 7 comments · Fixed by #1531
Closed

Generator rejected this profile with IllegalStateException #1520

leeyuiwah-sl opened this issue Nov 5, 2019 · 7 comments · Fixed by #1531
Assignees
Labels
bug Something isn't working

Comments

@leeyuiwah-sl
Copy link
Contributor

Bug Report

Steps to Reproduce:

  1. Run the generator with the attached profile
java -jar libs/generator.jar generate --max-rows=100 --replace --profile-file=pairwiseNumberEqualTo-profile2.json --output-path=test/test.csv
  1. Got an error of IllegalStateException (see below)

Expected Result:

I expect Generator to accept the profile

Actual Result:

Got the following error:

java.lang.IllegalStateException: Failed to merge field specs in related fields
        at com.scottlogic.deg.generator.generation.grouped.FieldSpecGroupValueGenerator.lambda$updateFirstSpecFromRelations$6(FieldSpecGroupValueGenerator.java:88)
        at java.base/java.util.Optional.orElseThrow(Unknown Source)
        at com.scottlogic.deg.generator.generation.grouped.FieldSpecGroupValueGenerator.updateFirstSpecFromRelations(FieldSpecGroupValueGenerator.java:88)
        at com.scottlogic.deg.generator.generation.grouped.FieldSpecGroupValueGenerator.generate(FieldSpecGroupValueGenerator.java:57)
        at com.scottlogic.deg.generator.generation.databags.RowSpecDataBagGenerator.lambda$createDataBags$0(RowSpecDataBagGenerator.java:43)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
        at com.scottlogic.deg.generator.generation.combinationstrategies.MinimalCombinationStrategy.permute(MinimalCombinationStrategy.java:32)
        at com.scottlogic.deg.generator.generation.databags.RowSpecDataBagGenerator.createDataBags(RowSpecDataBagGenerator.java:45)
        at com.scottlogic.deg.generator.walker.rowspec.RandomRowSpecDecisionTreeWalker.generateWithoutRestarting(RandomRowSpecDecisionTreeWalker.java:68)
        at com.scottlogic.deg.generator.walker.rowspec.RandomRowSpecDecisionTreeWalker.walk(RandomRowSpecDecisionTreeWalker.java:53)
        at com.scottlogic.deg.generator.generation.DecisionTreeDataGenerator.lambda$generateData$0(DecisionTreeDataGenerator.java:88)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
        at com.scottlogic.deg.generator.generation.combinationstrategies.MinimalCombinationStrategy.permute(MinimalCombinationStrategy.java:32)
        at com.scottlogic.deg.generator.generation.DecisionTreeDataGenerator.generateData(DecisionTreeDataGenerator.java:90)
        at com.scottlogic.deg.orchestrator.generate.GenerateExecute.execute(GenerateExecute.java:58)
        at com.scottlogic.deg.orchestrator.generate.GenerateCommandLine.call(GenerateCommandLine.java:58)
        at com.scottlogic.deg.orchestrator.generate.GenerateCommandLine.call(GenerateCommandLine.java:43)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1743)
        at picocli.CommandLine.access$900(CommandLine.java:145)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2101)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2068)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1935)
        at picocli.CommandLine.execute(CommandLine.java:1864)
        at com.scottlogic.deg.orchestrator.App.main(App.java:35)

Environment:

Build of v1.30.0 (dated Nov 1, SHA5: 633cf64c9a3eb496585e102f832b1efc100e1ff9)

Additional Context:

The generator accept other simplier profiles (I can share those if interested)

The GitHub UI does not allow me directly attached a .json file, so I renamed it to .json.txt

pairwiseNumberEqualTo-profile2.json.txt

@leeyuiwah-sl
Copy link
Contributor Author

I think one possible reason for the Generator to fail is that in the profile, there are more than one pairwise relationships for the same field.

The Generator accepts these other two simpler profiles, which do not have more than one pairwise relationships:

pairwiseNumberEqualTo-profile2a.json.txt
pairwiseDateEqualTo-profile2.json.txt

@cdowding-sl cdowding-sl self-assigned this Nov 8, 2019
@cdowding-sl
Copy link
Contributor

cdowding-sl commented Nov 8, 2019

This is not unexpected behaviour.

This json provided contains contradictory constraints, which are not present in the other two valid jsons, and this is thrown as an exception in FieldSpecGroupValueGenerator.java - 89:40.

If the message is the issue (i.e not particularly helpful to the user), then I would agree as it isn't technically an exception since it is valid domain flow. We should agree an approach to this further within a group discussion.

cdowding-sl added a commit to cdowding-sl/datahelix that referenced this issue Nov 11, 2019
@cdowding-sl cdowding-sl mentioned this issue Nov 11, 2019
@leeyuiwah-sl
Copy link
Contributor Author

@cdowding-sl -- Let's have a discussion face to face. The profile may not actually be contradictory. Thanks!

@cdowding-sl
Copy link
Contributor

This profile is not contradictory and is therefore failing unexpectedly.

@cdowding-sl cdowding-sl reopened this Nov 14, 2019
@leeyuiwah-sl
Copy link
Contributor Author

Thanks!

@willsalt-sl willsalt-sl added the bug Something isn't working label Nov 18, 2019
cdowding-sl added a commit to cdowding-sl/datahelix that referenced this issue Nov 18, 2019
@cdowding-sl
Copy link
Contributor

Blocked by #1489

@cdowding-sl
Copy link
Contributor

Copy of #1489

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants