From 19e7ae797a8066ccded6ffa53fbcdb0df35ec2bc Mon Sep 17 00:00:00 2001 From: prasar-ashutosh Date: Wed, 11 Oct 2023 16:13:10 +0800 Subject: [PATCH 1/2] Refactor Version Resolver --- .../ingestmode/AppendOnlyAbstract.java | 10 +++--- .../ingestmode/BitemporalDeltaAbstract.java | 6 ++-- .../NontemporalSnapshotAbstract.java | 6 ++-- .../UnitemporalSnapshotAbstract.java | 32 +++++++++++++++++++ .../AllVersionsStrategyAbstract.java | 7 ++-- .../MaxVersionStrategyAbstract.java | 4 +-- .../VersioningConditionVisitor.java | 4 +-- ...omparator.java => VersioningResolver.java} | 8 ++--- .../planner/UnitemporalSnapshotPlanner.java | 5 +-- .../components/util/LogicalPlanUtilsTest.java | 6 ++-- .../BitemporalDeltaWithBatchIdTest.java | 18 +++++------ .../nontemporal/AppendOnlyTest.java | 10 +++--- .../nontemporal/NontemporalDeltaTest.java | 18 +++++------ .../nontemporal/NontemporalSnapshotTest.java | 7 ++-- .../unitemporal/UnitemporalDeltaTest.java | 22 ++++++------- .../versioning/TestDedupAndVersioning.java | 26 +++++++-------- .../scenarios/AppendOnlyScenarios.java | 12 +++---- ...ourceSpecifiesFromAndThroughScenarios.java | 6 ++-- ...DeltaSourceSpecifiesFromOnlyScenarios.java | 10 +++--- .../scenarios/NonTemporalDeltaScenarios.java | 10 +++--- .../NontemporalSnapshotTestScenarios.java | 4 +-- ...UnitemporalDeltaBatchIdBasedScenarios.java | 10 +++--- 22 files changed, 134 insertions(+), 107 deletions(-) rename legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/{VersioningComparator.java => VersioningResolver.java} (84%) diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/AppendOnlyAbstract.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/AppendOnlyAbstract.java index 1b39e56049d..08d13bbbcf3 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/AppendOnlyAbstract.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/AppendOnlyAbstract.java @@ -18,7 +18,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategyAbstract; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningStrategyVisitor; import org.immutables.value.Value; @@ -61,9 +61,9 @@ public Void visitNoVersioningStrategy(NoVersioningStrategyAbstract noVersioningS @Override public Void visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionStrategy) { - if (maxVersionStrategy.versioningComparator() != VersioningComparator.ALWAYS) + if (maxVersionStrategy.versioningComparator() != VersioningResolver.DIGEST_BASED) { - throw new IllegalStateException("Cannot build AppendOnly, versioning comparator can only be Always"); + throw new IllegalStateException("Cannot build AppendOnly, Only DIGEST_BASED VersioningResolver allowed for this ingest mode"); } return null; } @@ -71,9 +71,9 @@ public Void visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionStrateg @Override public Void visitAllVersionsStrategy(AllVersionsStrategyAbstract allVersionsStrategyAbstract) { - if (allVersionsStrategyAbstract.versioningComparator() != VersioningComparator.ALWAYS) + if (allVersionsStrategyAbstract.versioningComparator() != VersioningResolver.DIGEST_BASED) { - throw new IllegalStateException("Cannot build AppendOnly, versioning comparator can only be Always"); + throw new IllegalStateException("Cannot build AppendOnly, Only DIGEST_BASED VersioningResolver allowed for this ingest mode"); } return null; } diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/BitemporalDeltaAbstract.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/BitemporalDeltaAbstract.java index 0514c31afe9..383d596fd94 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/BitemporalDeltaAbstract.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/BitemporalDeltaAbstract.java @@ -25,7 +25,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategyAbstract; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningStrategyVisitor; import org.immutables.value.Value; @@ -89,9 +89,9 @@ public Void visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionStrateg @Override public Void visitAllVersionsStrategy(AllVersionsStrategyAbstract allVersionsStrategyAbstract) { - if (allVersionsStrategyAbstract.versioningComparator() != VersioningComparator.ALWAYS) + if (allVersionsStrategyAbstract.versioningComparator() != VersioningResolver.DIGEST_BASED) { - throw new IllegalStateException("Cannot build BitemporalDelta, versioning comparator can only be Always"); + throw new IllegalStateException("Cannot build BitemporalDelta, Only DIGEST_BASED VersioningResolver allowed for this ingest mode"); } if (allVersionsStrategyAbstract.performVersioning()) { diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/NontemporalSnapshotAbstract.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/NontemporalSnapshotAbstract.java index a7f6646ee9f..26b216f16f6 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/NontemporalSnapshotAbstract.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/NontemporalSnapshotAbstract.java @@ -18,7 +18,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategyAbstract; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningStrategyVisitor; import org.immutables.value.Value; @@ -58,9 +58,9 @@ public Void visitNoVersioningStrategy(NoVersioningStrategyAbstract noVersioningS @Override public Void visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionStrategy) { - if (maxVersionStrategy.versioningComparator() != VersioningComparator.ALWAYS) + if (maxVersionStrategy.versioningComparator() != VersioningResolver.DIGEST_BASED) { - throw new IllegalStateException("Cannot build NontemporalSnapshot, versioning comparator can only be Always"); + throw new IllegalStateException("Cannot build NontemporalSnapshot, Only DIGEST_BASED VersioningResolver allowed for this ingest mode"); } return null; } diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/UnitemporalSnapshotAbstract.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/UnitemporalSnapshotAbstract.java index 0ed6847395f..d85e9cb2d95 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/UnitemporalSnapshotAbstract.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/UnitemporalSnapshotAbstract.java @@ -18,6 +18,11 @@ import org.finos.legend.engine.persistence.components.ingestmode.emptyhandling.EmptyDatasetHandling; import org.finos.legend.engine.persistence.components.ingestmode.transactionmilestoning.TransactionMilestoned; import org.finos.legend.engine.persistence.components.ingestmode.transactionmilestoning.TransactionMilestoning; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningStrategyVisitor; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategyAbstract; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategyAbstract; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategyAbstract; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.immutables.value.Value; import java.util.List; @@ -83,5 +88,32 @@ default void validate() } } } + + // Allowed Versioning Strategy - NoVersioning, MaxVersioining + this.versioningStrategy().accept(new VersioningStrategyVisitor() + { + @Override + public Void visitNoVersioningStrategy(NoVersioningStrategyAbstract noVersioningStrategy) + { + return null; + } + + @Override + public Void visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionStrategy) + { + if (maxVersionStrategy.versioningComparator() != VersioningResolver.DIGEST_BASED) + { + throw new IllegalStateException("Cannot build UnitemporalSnapshot, Only DIGEST_BASED VersioningResolver allowed for this ingest mode"); + } + return null; + } + + @Override + public Void visitAllVersionsStrategy(AllVersionsStrategyAbstract allVersionsStrategyAbstract) + { + throw new IllegalStateException("Cannot build UnitemporalSnapshot, AllVersionsStrategy not supported"); + } + }); + } } diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/AllVersionsStrategyAbstract.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/AllVersionsStrategyAbstract.java index b4c50c29f63..ac6d2245423 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/AllVersionsStrategyAbstract.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/AllVersionsStrategyAbstract.java @@ -14,9 +14,6 @@ package org.finos.legend.engine.persistence.components.ingestmode.versioning; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningStrategyVisitor; import org.immutables.value.Value; import static org.immutables.value.Value.Immutable; @@ -39,9 +36,9 @@ public interface AllVersionsStrategyAbstract extends VersioningStrategy String versioningField(); @Value.Default - default VersioningComparator versioningComparator() + default VersioningResolver versioningComparator() { - return VersioningComparator.GREATER_THAN; + return VersioningResolver.DIGEST_BASED; } @Value.Default diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/MaxVersionStrategyAbstract.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/MaxVersionStrategyAbstract.java index 121cbfcc910..cf45d9c3d17 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/MaxVersionStrategyAbstract.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/MaxVersionStrategyAbstract.java @@ -33,9 +33,9 @@ public interface MaxVersionStrategyAbstract extends VersioningStrategy String versioningField(); @Value.Default - default VersioningComparator versioningComparator() + default VersioningResolver versioningComparator() { - return VersioningComparator.GREATER_THAN; + return VersioningResolver.DIGEST_BASED; } @Value.Default diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningConditionVisitor.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningConditionVisitor.java index 519ef66f824..88e7bdd2921 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningConditionVisitor.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningConditionVisitor.java @@ -61,7 +61,7 @@ public Condition visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionSt switch (maxVersionStrategy.versioningComparator()) { - case GREATER_THAN: + case GREATER_THAN_ACTIVE_VERSION: if (invertComparison) { return LessThanEqualTo.of(stagingVersioningField, mainVersioningField); @@ -70,7 +70,7 @@ public Condition visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionSt { return GreaterThan.of(stagingVersioningField, mainVersioningField); } - case GREATER_THAN_EQUAL_TO: + case GREATER_THAN_EQUAL_TO_ACTIVE_VERSION: if (invertComparison) { return LessThan.of(stagingVersioningField, mainVersioningField); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningComparator.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningResolver.java similarity index 84% rename from legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningComparator.java rename to legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningResolver.java index e2959d9482e..b88691dd381 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningComparator.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningResolver.java @@ -14,9 +14,9 @@ package org.finos.legend.engine.persistence.components.ingestmode.versioning; -public enum VersioningComparator +public enum VersioningResolver { - GREATER_THAN, - GREATER_THAN_EQUAL_TO, - ALWAYS + GREATER_THAN_ACTIVE_VERSION, + GREATER_THAN_EQUAL_TO_ACTIVE_VERSION, + DIGEST_BASED } diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/planner/UnitemporalSnapshotPlanner.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/planner/UnitemporalSnapshotPlanner.java index e50e8492a0c..e0cbd780cd0 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/planner/UnitemporalSnapshotPlanner.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/planner/UnitemporalSnapshotPlanner.java @@ -139,12 +139,13 @@ protected Insert sqlToUpsertRows() .addFields(FieldValue.builder().datasetRef(mainDataset().datasetReference()).fieldName(ingestMode().digestField()).build()) .build())); - List fieldsToSelect = new ArrayList<>(stagingDataset().schemaReference().fieldValues()); + List dataFields = getDataFields(); + List fieldsToSelect = new ArrayList<>(dataFields); List milestoneUpdateValues = transactionMilestoningFieldValues(); fieldsToSelect.addAll(milestoneUpdateValues); Dataset selectStage = Selection.builder().source(stagingDataset()).condition(notInSinkCondition).addAllFields(fieldsToSelect).build(); - List fieldsToInsert = new ArrayList<>(stagingDataset().schemaReference().fieldValues()); + List fieldsToInsert = new ArrayList<>(dataFields); fieldsToInsert.addAll(transactionMilestoningFields()); return Insert.of(mainDataset(), selectStage, fieldsToInsert); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-ansi/src/test/java/org/finos/legend/engine/persistence/components/util/LogicalPlanUtilsTest.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-ansi/src/test/java/org/finos/legend/engine/persistence/components/util/LogicalPlanUtilsTest.java index 94ce281accb..8ffb213fc5e 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-ansi/src/test/java/org/finos/legend/engine/persistence/components/util/LogicalPlanUtilsTest.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-ansi/src/test/java/org/finos/legend/engine/persistence/components/util/LogicalPlanUtilsTest.java @@ -38,7 +38,7 @@ import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; -import static org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator.GREATER_THAN; +import static org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver.GREATER_THAN_ACTIVE_VERSION; public class LogicalPlanUtilsTest extends IngestModeTest { @@ -57,7 +57,7 @@ public void testDeduplicateByMaxVersion() RelationalTransformer transformer = new RelationalTransformer(AnsiSqlSink.get()); List primaryKeys = Arrays.asList("id", "name"); - VersioningStrategy versioningStrategy = MaxVersionStrategy.builder().versioningField("version").performVersioning(true).versioningComparator(GREATER_THAN).build(); + VersioningStrategy versioningStrategy = MaxVersionStrategy.builder().versioningField("version").performVersioning(true).versioningComparator(GREATER_THAN_ACTIVE_VERSION).build(); Selection selection = (Selection) versioningStrategy.accept(new DatasetDeduplicator(dataset, primaryKeys)); LogicalPlan logicalPlan = LogicalPlan.builder().addOps(selection).build(); SqlPlan physicalPlan = transformer.generatePhysicalPlan(logicalPlan); @@ -87,7 +87,7 @@ public void testDeduplicateByMaxVersionAndFilterDataset() .addDatasetFilters(DatasetFilter.of("biz_date", FilterType.LESS_THAN, "2020-01-03")) .build(); - VersioningStrategy versioningStrategy = MaxVersionStrategy.builder().versioningField("version").performVersioning(true).versioningComparator(GREATER_THAN).build(); + VersioningStrategy versioningStrategy = MaxVersionStrategy.builder().versioningField("version").performVersioning(true).versioningComparator(GREATER_THAN_ACTIVE_VERSION).build(); Selection selection = (Selection) versioningStrategy.accept(new DatasetDeduplicator(dataset, primaryKeys)); LogicalPlan logicalPlan = LogicalPlan.builder().addOps(selection).build(); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/bitemporal/BitemporalDeltaWithBatchIdTest.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/bitemporal/BitemporalDeltaWithBatchIdTest.java index a2b8c3d1851..5ad5db3bbec 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/bitemporal/BitemporalDeltaWithBatchIdTest.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/bitemporal/BitemporalDeltaWithBatchIdTest.java @@ -24,7 +24,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.validitymilestoning.derivation.SourceSpecifiesFromAndThruDateTime; import org.finos.legend.engine.persistence.components.ingestmode.validitymilestoning.derivation.SourceSpecifiesFromDateTime; import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition; import org.finos.legend.engine.persistence.components.planner.PlannerOptions; @@ -516,7 +516,7 @@ void testMilestoningSourceSpecifiesFromSet3WithDataSplit() throws Exception .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -598,7 +598,7 @@ void testMilestoningSourceSpecifiesFromSet3WithDataSplitMultiPasses() throws Exc .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -788,7 +788,7 @@ void testMilestoningSourceSpecifiesFromSet5WithDataSplitFilterDuplicates() throw .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -871,7 +871,7 @@ void testMilestoningSourceSpecifiesFromSet5WithDataSplitFilterDuplicatesMultiPas .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -1121,7 +1121,7 @@ void testMilestoningSourceSpecifiesFromWithDeleteIndicatorSet3WithDataSplit() th .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -1202,7 +1202,7 @@ void testMilestoningSourceSpecifiesFromWithDeleteIndicatorSet3WithDataSplitWithM .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -1390,7 +1390,7 @@ void testMilestoningSourceSpecifiesFromWithDeleteIndicatorSet5WithDataSplitFilte .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -1475,7 +1475,7 @@ void testMilestoningSourceSpecifiesFromWithDeleteIndicatorSet5WithDataSplitFilte .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/AppendOnlyTest.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/AppendOnlyTest.java index e6642250667..7ba0f065464 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/AppendOnlyTest.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/AppendOnlyTest.java @@ -27,7 +27,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition; import org.finos.legend.engine.persistence.components.planner.PlannerOptions; @@ -194,7 +194,7 @@ void testAppendOnlyWithAuditingMaxVersionFilterDuplicatesFilterExistingRecordsUp .deduplicationStrategy(FilterDuplicates.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeName).build()) @@ -243,7 +243,7 @@ void testAppendOnlyWithAuditingMaxVersionFilterDuplicatesNoFilterExistingRecords .deduplicationStrategy(FilterDuplicates.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeName).build()) @@ -294,7 +294,7 @@ void testAppendOnlyWithAuditingAllVersionFilterDuplicatesFilterExistingRecords() .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeName).build()) @@ -345,7 +345,7 @@ void testAppendOnlyWithAuditingAllVersionFilterDuplicatesNoFilterExistingRecords .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeName).build()) diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalDeltaTest.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalDeltaTest.java index 72d2c8d4e7f..8ed498e9b6c 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalDeltaTest.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalDeltaTest.java @@ -23,7 +23,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.audit.DateTimeAuditing; import org.finos.legend.engine.persistence.components.ingestmode.audit.NoAuditing; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.ingestmode.merge.DeleteIndicatorMergeStrategy; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition; @@ -341,7 +341,7 @@ void testNonTemporalDeltaWithMaxVersioningGreaterThan() throws Exception .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -394,7 +394,7 @@ void testNonTemporalDeltaWithMaxVersioningGreaterThanEqualTo() throws Exception .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN_EQUAL_TO) + .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -447,7 +447,7 @@ void testNonTemporalDeltaWithMaxVersioningGreaterThanWithDedup() throws Exceptio .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -500,7 +500,7 @@ void testNonTemporalDeltaWithMaxVersioningGreaterThanEqualToWithDedup() throws E .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN_EQUAL_TO) + .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -605,7 +605,7 @@ void testNonTemporalDeltaWithFilterStagingTableWithMaxVersioningGreaterThan() th .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -661,7 +661,7 @@ void testNonTemporalDeltaWithFilterStagingTableWithMaxVersioningGreaterThanEqual .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN_EQUAL_TO) + .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -717,7 +717,7 @@ void testNonTemporalDeltaWithFilterStagingTableWithMaxVersioningGreaterThanWithD .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -773,7 +773,7 @@ void testNonTemporalDeltaWithFilterStagingTableWithMaxVersioningGreaterThanEqual .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN_EQUAL_TO) + .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalSnapshotTest.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalSnapshotTest.java index 260a5ef316b..c29b00b9d8d 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalSnapshotTest.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalSnapshotTest.java @@ -22,19 +22,16 @@ import org.finos.legend.engine.persistence.components.ingestmode.audit.NoAuditing; import org.finos.legend.engine.persistence.components.ingestmode.deduplication.FilterDuplicates; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition; import org.finos.legend.engine.persistence.components.planner.PlannerOptions; -import org.finos.legend.engine.persistence.components.relational.api.DataSplitRange; import org.finos.legend.engine.persistence.components.versioning.TestDedupAndVersioning; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.logging.Filter; import static org.finos.legend.engine.persistence.components.TestUtils.*; @@ -268,7 +265,7 @@ void testNontemporalSnapshotWithMaxVersionAndFilterDuplicates() throws Exception // Generate the milestoning object NontemporalSnapshot ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").versioningComparator(VersioningComparator.ALWAYS).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").versioningComparator(VersioningResolver.DIGEST_BASED).build()) .deduplicationStrategy(FilterDuplicates.builder().build()) .build(); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/unitemporal/UnitemporalDeltaTest.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/unitemporal/UnitemporalDeltaTest.java index 32cf752a38b..efade9fec67 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/unitemporal/UnitemporalDeltaTest.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/unitemporal/UnitemporalDeltaTest.java @@ -20,7 +20,7 @@ import org.finos.legend.engine.persistence.components.common.OptimizationFilter; import org.finos.legend.engine.persistence.components.ingestmode.UnitemporalDelta; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.ingestmode.merge.DeleteIndicatorMergeStrategy; import org.finos.legend.engine.persistence.components.ingestmode.transactionmilestoning.BatchIdAndDateTime; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; @@ -252,7 +252,7 @@ void testMilestoningWithMaxVersioningGreaterThan() throws Exception .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -312,7 +312,7 @@ void testMilestoningWithMaxVersioningGreaterThanEqualTo() throws Exception .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN_EQUAL_TO) + .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -372,7 +372,7 @@ void testMilestoningWithMaxVersioningGreaterThanWithDedup() throws Exception .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -432,7 +432,7 @@ void testMilestoningWithMaxVersioningGreaterThanEqualToWithDedup() throws Except .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN_EQUAL_TO) + .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -558,7 +558,7 @@ void testMilestoningWithFilterStagingTableWithMaxVersioningGreaterThan() throws .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -621,7 +621,7 @@ void testMilestoningWithFilterStagingTableWithMaxVersioningGreaterThanEqualTo() .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN_EQUAL_TO) + .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -684,7 +684,7 @@ void testMilestoningWithFilterStagingTableWithMaxVersioningGreaterThanWithDedup( .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -747,7 +747,7 @@ void testMilestoningWithFilterStagingTableWithMaxVersioningGreaterThanEqualToWit .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN_EQUAL_TO) + .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -809,7 +809,7 @@ void testMilestoningWithFilterStagingTableWithMaxVersioningGreaterThanWithDedupW .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -868,7 +868,7 @@ void testMilestoningWithMaxVersioningFail() throws Exception .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(nameName) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/versioning/TestDedupAndVersioning.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/versioning/TestDedupAndVersioning.java index c1139bce728..19860a5ec5c 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/versioning/TestDedupAndVersioning.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/versioning/TestDedupAndVersioning.java @@ -28,7 +28,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.deduplication.FilterDuplicates; import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.logicalplan.datasets.*; import org.finos.legend.engine.persistence.components.relational.api.RelationalIngestor; import org.finos.legend.engine.persistence.components.relational.h2.H2Sink; @@ -124,7 +124,7 @@ void testNoDedupMaxVersioningDoNotPerform() Datasets datasets = Datasets.of(mainTable, stagingTable); IngestMode ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(false).versioningComparator(VersioningComparator.ALWAYS).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(false).versioningComparator(VersioningResolver.DIGEST_BASED).build()) .build(); performDedupAndVersioining(datasets, ingestMode); @@ -142,7 +142,7 @@ void testNoDedupMaxVersioning() throws Exception IngestMode ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) .deduplicationStrategy(AllowDuplicates.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").versioningComparator(VersioningComparator.ALWAYS).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").versioningComparator(VersioningResolver.DIGEST_BASED).build()) .build(); createStagingTableWithVersion(); @@ -178,7 +178,7 @@ void testNoDedupAllVersioningDoNotPerform() .auditing(DateTimeAuditing.builder().dateTimeField("append_time").build()) .digestField("digest") .deduplicationStrategy(AllowDuplicates.builder().build()) - .versioningStrategy(AllVersionsStrategy.builder().versioningField("version").performVersioning(false).versioningComparator(VersioningComparator.ALWAYS).build()) + .versioningStrategy(AllVersionsStrategy.builder().versioningField("version").performVersioning(false).versioningComparator(VersioningResolver.DIGEST_BASED).build()) .build(); performDedupAndVersioining(datasets, ingestMode); @@ -198,7 +198,7 @@ void testNoDedupAllVersion() throws Exception .digestField("digest") .deduplicationStrategy(AllowDuplicates.builder().build()) .versioningStrategy(AllVersionsStrategy.builder().versioningField("version") - .versioningComparator(VersioningComparator.ALWAYS).performVersioning(true).build()) + .versioningComparator(VersioningResolver.DIGEST_BASED).performVersioning(true).build()) .build(); createStagingTableWithVersion(); @@ -254,7 +254,7 @@ void testFilterDupsMaxVersionDoNotPerform() throws Exception IngestMode ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) .deduplicationStrategy(FilterDuplicates.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(false).versioningComparator(VersioningComparator.ALWAYS).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(false).versioningComparator(VersioningResolver.DIGEST_BASED).build()) .build(); createStagingTableWithVersion(); @@ -277,7 +277,7 @@ void testFilterDupsMaxVersion() throws Exception IngestMode ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) .deduplicationStrategy(FilterDuplicates.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").versioningComparator(VersioningComparator.ALWAYS).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").versioningComparator(VersioningResolver.DIGEST_BASED).build()) .build(); createStagingTableWithVersion(); @@ -314,7 +314,7 @@ void testFilterDupsAllVersionDoNotPerform() throws Exception .digestField("digest") .deduplicationStrategy(FilterDuplicates.builder().build()) .versioningStrategy(AllVersionsStrategy.builder().versioningField("version") - .versioningComparator(VersioningComparator.ALWAYS).performVersioning(false).build()) + .versioningComparator(VersioningResolver.DIGEST_BASED).performVersioning(false).build()) .build(); createStagingTableWithVersion(); @@ -339,7 +339,7 @@ void testFilterDupsAllVersion() throws Exception .digestField("digest") .deduplicationStrategy(FilterDuplicates.builder().build()) .versioningStrategy(AllVersionsStrategy.builder().versioningField("version") - .versioningComparator(VersioningComparator.ALWAYS).performVersioning(true).build()) + .versioningComparator(VersioningResolver.DIGEST_BASED).performVersioning(true).build()) .build(); createStagingTableWithVersion(); @@ -401,7 +401,7 @@ void testFailOnDupsMaxVersionDoNotPerform() throws Exception IngestMode ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) .deduplicationStrategy(FailOnDuplicates.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(false).versioningComparator(VersioningComparator.ALWAYS).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(false).versioningComparator(VersioningResolver.DIGEST_BASED).build()) .build(); // Happy scenario @@ -439,7 +439,7 @@ void testFailOnDupsMaxVersion() throws Exception IngestMode ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) .deduplicationStrategy(FailOnDuplicates.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(true).versioningComparator(VersioningComparator.ALWAYS).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(true).versioningComparator(VersioningResolver.DIGEST_BASED).build()) .build(); // Happy scenario @@ -480,7 +480,7 @@ void testFailOnDupsAllVersionDoNotPerform() throws Exception .digestField("digest") .deduplicationStrategy(FailOnDuplicates.builder().build()) .versioningStrategy(AllVersionsStrategy.builder().versioningField("version") - .versioningComparator(VersioningComparator.ALWAYS).performVersioning(false).build()) + .versioningComparator(VersioningResolver.DIGEST_BASED).performVersioning(false).build()) .build(); // Happy scenario @@ -520,7 +520,7 @@ void testFailOnDupsAllVersion() throws Exception .digestField("digest") .deduplicationStrategy(FailOnDuplicates.builder().build()) .versioningStrategy(AllVersionsStrategy.builder().versioningField("version") - .versioningComparator(VersioningComparator.ALWAYS).performVersioning(true).build()) + .versioningComparator(VersioningResolver.DIGEST_BASED).performVersioning(true).build()) .build(); // Happy scenario diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/AppendOnlyScenarios.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/AppendOnlyScenarios.java index 8121a71a3df..3d6e5b484cf 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/AppendOnlyScenarios.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/AppendOnlyScenarios.java @@ -24,7 +24,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; public class AppendOnlyScenarios extends BaseTest { @@ -127,7 +127,7 @@ public TestScenario FAIL_ON_DUPLICATES_WITH_AUDITING_ALL_VERSION_NO_FILTER_EXIST .versioningStrategy(AllVersionsStrategy.builder() .versioningField(bizDateField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeField).build()) @@ -145,7 +145,7 @@ public TestScenario FILTER_DUPLICATES_NO_AUDITING_ALL_VERSION_NO_FILTER_EXISTING .versioningStrategy(AllVersionsStrategy.builder() .versioningField(bizDateField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(NoAuditing.builder().build()) @@ -162,7 +162,7 @@ public TestScenario FILTER_DUPLICATES_WITH_AUDITING_ALL_VERSION_WITH_FILTER_EXIS .versioningStrategy(AllVersionsStrategy.builder() .versioningField(bizDateField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeField).build()) @@ -178,7 +178,7 @@ public TestScenario FAIL_ON_DUPLICATES_WITH_AUDITING_MAX_VERSION_WITH_FILTER_EXI .deduplicationStrategy(FailOnDuplicates.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(bizDateField) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeField).build()) @@ -194,7 +194,7 @@ public TestScenario FILTER_DUPLICATES_WITH_AUDITING_MAX_VERSION_NO_FILTER_EXISTI .deduplicationStrategy(FilterDuplicates.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(bizDateField) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeField).build()) diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromAndThroughScenarios.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromAndThroughScenarios.java index fca8de22fdc..6e0f1e0dca8 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromAndThroughScenarios.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromAndThroughScenarios.java @@ -23,7 +23,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.validitymilestoning.ValidDateTime; import org.finos.legend.engine.persistence.components.ingestmode.validitymilestoning.derivation.SourceSpecifiesFromAndThruDateTime; import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition; import org.finos.legend.engine.persistence.components.logicalplan.datasets.SchemaDefinition; @@ -74,7 +74,7 @@ public TestScenario BATCH_ID_AND_TIME_BASED__NO_DEL_IND__WITH_DATA_SPLITS() .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchIdAndDateTime.builder() @@ -126,7 +126,7 @@ public TestScenario DATETIME_BASED__WITH_DEL_IND__WITH_DATA_SPLITS() .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(TransactionDateTime.builder() diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromOnlyScenarios.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromOnlyScenarios.java index 1389c74eaa9..7ce7de4e572 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromOnlyScenarios.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromOnlyScenarios.java @@ -24,7 +24,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.validitymilestoning.ValidDateTime; import org.finos.legend.engine.persistence.components.ingestmode.validitymilestoning.derivation.SourceSpecifiesFromDateTime; import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition; import org.finos.legend.engine.persistence.components.logicalplan.datasets.SchemaDefinition; @@ -89,7 +89,7 @@ public TestScenario BATCH_ID_BASED__NO_DEL_IND__WITH_DATA_SPLITS() .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -151,7 +151,7 @@ public TestScenario BATCH_ID_BASED__WITH_DEL_IND__WITH_DATA_SPLITS__USING_DEFAUL .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -207,7 +207,7 @@ public TestScenario BATCH_ID_BASED__NO_DEL_IND__WITH_DATA_SPLITS__FILTER_DUPLICA .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -287,7 +287,7 @@ public TestScenario BATCH_ID_BASED__WITH_DEL_IND__WITH_DATA_SPLITS__FILTER_DUPLI .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningComparator.ALWAYS) + .versioningComparator(VersioningResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NonTemporalDeltaScenarios.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NonTemporalDeltaScenarios.java index 327e3200650..56ce3235708 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NonTemporalDeltaScenarios.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NonTemporalDeltaScenarios.java @@ -23,7 +23,7 @@ import java.util.Optional; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.ingestmode.merge.DeleteIndicatorMergeStrategy; public class NonTemporalDeltaScenarios extends BaseTest @@ -106,7 +106,7 @@ public TestScenario MAX_VERSIONING_WITH_GREATER_THAN__DEDUP__WITH_STAGING_FILTER .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(version.name()) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -120,7 +120,7 @@ public TestScenario MAX_VERSIONING_WITH_GREATER_THAN__NO_DEDUP__WITH_STAGING_FIL .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(version.name()) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -134,7 +134,7 @@ public TestScenario MAX_VERSIONING_WITH_GREATER_THAN__NO_DEDUP__WITHOUT_STAGING_ .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(version.name()) - .versioningComparator(VersioningComparator.GREATER_THAN) + .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -148,7 +148,7 @@ public TestScenario MAX_VERSIONING_WITH_GREATER_THAN_EQUAL__DEDUP__WITHOUT_STAGI .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(version.name()) - .versioningComparator(VersioningComparator.GREATER_THAN_EQUAL_TO) + .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NontemporalSnapshotTestScenarios.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NontemporalSnapshotTestScenarios.java index e59b9fdadfe..0afe9950af0 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NontemporalSnapshotTestScenarios.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NontemporalSnapshotTestScenarios.java @@ -22,7 +22,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.deduplication.FilterDuplicates; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; public class NontemporalSnapshotTestScenarios extends BaseTest { @@ -63,7 +63,7 @@ public TestScenario WITH_AUDTING__FAIL_ON_DUP_MAX_VERSIONING() { NontemporalSnapshot ingestMode = NontemporalSnapshot.builder() .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeField).build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("biz_date").versioningComparator(VersioningComparator.ALWAYS).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("biz_date").versioningComparator(VersioningResolver.DIGEST_BASED).build()) .deduplicationStrategy(FailOnDuplicates.builder().build()) .build(); return new TestScenario(mainTableWithBaseSchemaHavingAuditField, stagingTableWithBaseSchema, ingestMode); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/UnitemporalDeltaBatchIdBasedScenarios.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/UnitemporalDeltaBatchIdBasedScenarios.java index 6bcf5eb3f57..76674e7d7f5 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/UnitemporalDeltaBatchIdBasedScenarios.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/UnitemporalDeltaBatchIdBasedScenarios.java @@ -19,7 +19,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.UnitemporalDelta; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningComparator; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; import org.finos.legend.engine.persistence.components.ingestmode.merge.DeleteIndicatorMergeStrategy; import org.finos.legend.engine.persistence.components.ingestmode.transactionmilestoning.BatchId; @@ -181,7 +181,7 @@ public TestScenario BATCH_ID_BASED__MAX_VERSIONING_WITH_GREATER_THAN__DEDUP__WIT .batchIdInName(batchIdInField) .batchIdOutName(batchIdOutField) .build()) - .versioningStrategy(MaxVersionStrategy.builder().performVersioning(true).versioningField(version.name()).versioningComparator(VersioningComparator.GREATER_THAN).build()) + .versioningStrategy(MaxVersionStrategy.builder().performVersioning(true).versioningField(version.name()).versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION).build()) .build(); return new TestScenario(mainTableWithBatchIdAndVersionBasedSchema, stagingTableWithFilterAndVersion, ingestMode); } @@ -194,7 +194,7 @@ public TestScenario BATCH_ID_BASED__MAX_VERSIONING_WITH_GREATER_THAN__NO_DEDUP__ .batchIdInName(batchIdInField) .batchIdOutName(batchIdOutField) .build()) - .versioningStrategy(MaxVersionStrategy.builder().performVersioning(false).versioningField(version.name()).versioningComparator(VersioningComparator.GREATER_THAN).build()) + .versioningStrategy(MaxVersionStrategy.builder().performVersioning(false).versioningField(version.name()).versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION).build()) .build(); return new TestScenario(mainTableWithBatchIdAndVersionBasedSchema, stagingTableWithFilterAndVersion, ingestMode); } @@ -207,7 +207,7 @@ public TestScenario BATCH_ID_BASED__MAX_VERSIONING_WITH_GREATER_THAN__NO_DEDUP__ .batchIdInName(batchIdInField) .batchIdOutName(batchIdOutField) .build()) - .versioningStrategy(MaxVersionStrategy.builder().performVersioning(false).versioningField(version.name()).versioningComparator(VersioningComparator.GREATER_THAN).build()) + .versioningStrategy(MaxVersionStrategy.builder().performVersioning(false).versioningField(version.name()).versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION).build()) .build(); return new TestScenario(mainTableWithBatchIdAndVersionBasedSchema, stagingTableWithVersion, ingestMode); } @@ -220,7 +220,7 @@ public TestScenario BATCH_ID_BASED__MAX_VERSIONING_WITH_GREATER_THAN_EQUAL__DEDU .batchIdInName(batchIdInField) .batchIdOutName(batchIdOutField) .build()) - .versioningStrategy(MaxVersionStrategy.builder().performVersioning(true).versioningField(version.name()).versioningComparator(VersioningComparator.GREATER_THAN_EQUAL_TO).build()) + .versioningStrategy(MaxVersionStrategy.builder().performVersioning(true).versioningField(version.name()).versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION).build()) .build(); return new TestScenario(mainTableWithBatchIdAndVersionBasedSchema, stagingTableWithVersion, ingestMode); } From 12d022d5138d7084275036c6170abdd57e5686b7 Mon Sep 17 00:00:00 2001 From: prasar-ashutosh Date: Wed, 11 Oct 2023 17:00:06 +0800 Subject: [PATCH 2/2] Refactor Version Resolver --- .../ingestmode/AppendOnlyAbstract.java | 6 ++--- .../ingestmode/BitemporalDeltaAbstract.java | 4 +-- .../ingestmode/IngestModeCaseConverter.java | 4 +-- .../NontemporalSnapshotAbstract.java | 4 +-- .../UnitemporalSnapshotAbstract.java | 4 +-- .../AllVersionsStrategyAbstract.java | 4 +-- .../MaxVersionStrategyAbstract.java | 4 +-- ...ningResolver.java => VersionResolver.java} | 2 +- .../VersioningConditionVisitor.java | 2 +- .../components/util/LogicalPlanUtilsTest.java | 6 ++--- .../BitemporalDeltaWithBatchIdTest.java | 18 ++++++------- .../nontemporal/AppendOnlyTest.java | 10 +++---- .../nontemporal/NontemporalDeltaTest.java | 18 ++++++------- .../nontemporal/NontemporalSnapshotTest.java | 4 +-- .../unitemporal/UnitemporalDeltaTest.java | 22 ++++++++-------- .../versioning/TestDedupAndVersioning.java | 26 +++++++++---------- .../scenarios/AppendOnlyScenarios.java | 12 ++++----- ...ourceSpecifiesFromAndThroughScenarios.java | 6 ++--- ...DeltaSourceSpecifiesFromOnlyScenarios.java | 10 +++---- .../scenarios/NonTemporalDeltaScenarios.java | 10 +++---- .../NontemporalSnapshotTestScenarios.java | 4 +-- ...UnitemporalDeltaBatchIdBasedScenarios.java | 10 +++---- 22 files changed, 95 insertions(+), 95 deletions(-) rename legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/{VersioningResolver.java => VersionResolver.java} (96%) diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/AppendOnlyAbstract.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/AppendOnlyAbstract.java index 08d13bbbcf3..4583c162b0c 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/AppendOnlyAbstract.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/AppendOnlyAbstract.java @@ -18,7 +18,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategyAbstract; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningStrategyVisitor; import org.immutables.value.Value; @@ -61,7 +61,7 @@ public Void visitNoVersioningStrategy(NoVersioningStrategyAbstract noVersioningS @Override public Void visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionStrategy) { - if (maxVersionStrategy.versioningComparator() != VersioningResolver.DIGEST_BASED) + if (maxVersionStrategy.versionResolver() != VersionResolver.DIGEST_BASED) { throw new IllegalStateException("Cannot build AppendOnly, Only DIGEST_BASED VersioningResolver allowed for this ingest mode"); } @@ -71,7 +71,7 @@ public Void visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionStrateg @Override public Void visitAllVersionsStrategy(AllVersionsStrategyAbstract allVersionsStrategyAbstract) { - if (allVersionsStrategyAbstract.versioningComparator() != VersioningResolver.DIGEST_BASED) + if (allVersionsStrategyAbstract.versionResolver() != VersionResolver.DIGEST_BASED) { throw new IllegalStateException("Cannot build AppendOnly, Only DIGEST_BASED VersioningResolver allowed for this ingest mode"); } diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/BitemporalDeltaAbstract.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/BitemporalDeltaAbstract.java index 383d596fd94..754b4590c50 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/BitemporalDeltaAbstract.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/BitemporalDeltaAbstract.java @@ -25,7 +25,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategyAbstract; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningStrategyVisitor; import org.immutables.value.Value; @@ -89,7 +89,7 @@ public Void visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionStrateg @Override public Void visitAllVersionsStrategy(AllVersionsStrategyAbstract allVersionsStrategyAbstract) { - if (allVersionsStrategyAbstract.versioningComparator() != VersioningResolver.DIGEST_BASED) + if (allVersionsStrategyAbstract.versionResolver() != VersionResolver.DIGEST_BASED) { throw new IllegalStateException("Cannot build BitemporalDelta, Only DIGEST_BASED VersioningResolver allowed for this ingest mode"); } diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/IngestModeCaseConverter.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/IngestModeCaseConverter.java index dd4904b6175..2721edc6367 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/IngestModeCaseConverter.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/IngestModeCaseConverter.java @@ -348,7 +348,7 @@ public VersioningStrategy visitMaxVersionStrategy(MaxVersionStrategyAbstract max { return MaxVersionStrategy .builder() - .versioningComparator(maxVersionStrategy.versioningComparator()) + .versionResolver(maxVersionStrategy.versionResolver()) .versioningField(strategy.apply(maxVersionStrategy.versioningField())) .performVersioning(maxVersionStrategy.performVersioning()) .build(); @@ -359,7 +359,7 @@ public VersioningStrategy visitAllVersionsStrategy(AllVersionsStrategyAbstract a { return AllVersionsStrategy .builder() - .versioningComparator(allVersionsStrategyAbstract.versioningComparator()) + .versionResolver(allVersionsStrategyAbstract.versionResolver()) .versioningField(strategy.apply(allVersionsStrategyAbstract.versioningField())) .dataSplitFieldName(strategy.apply(allVersionsStrategyAbstract.dataSplitFieldName())) .performVersioning(allVersionsStrategyAbstract.performVersioning()) diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/NontemporalSnapshotAbstract.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/NontemporalSnapshotAbstract.java index 26b216f16f6..f2ad2ef33e0 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/NontemporalSnapshotAbstract.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/NontemporalSnapshotAbstract.java @@ -18,7 +18,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategyAbstract; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningStrategyVisitor; import org.immutables.value.Value; @@ -58,7 +58,7 @@ public Void visitNoVersioningStrategy(NoVersioningStrategyAbstract noVersioningS @Override public Void visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionStrategy) { - if (maxVersionStrategy.versioningComparator() != VersioningResolver.DIGEST_BASED) + if (maxVersionStrategy.versionResolver() != VersionResolver.DIGEST_BASED) { throw new IllegalStateException("Cannot build NontemporalSnapshot, Only DIGEST_BASED VersioningResolver allowed for this ingest mode"); } diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/UnitemporalSnapshotAbstract.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/UnitemporalSnapshotAbstract.java index d85e9cb2d95..db2f41c7a2f 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/UnitemporalSnapshotAbstract.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/UnitemporalSnapshotAbstract.java @@ -22,7 +22,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategyAbstract; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategyAbstract; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.immutables.value.Value; import java.util.List; @@ -101,7 +101,7 @@ public Void visitNoVersioningStrategy(NoVersioningStrategyAbstract noVersioningS @Override public Void visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionStrategy) { - if (maxVersionStrategy.versioningComparator() != VersioningResolver.DIGEST_BASED) + if (maxVersionStrategy.versionResolver() != VersionResolver.DIGEST_BASED) { throw new IllegalStateException("Cannot build UnitemporalSnapshot, Only DIGEST_BASED VersioningResolver allowed for this ingest mode"); } diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/AllVersionsStrategyAbstract.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/AllVersionsStrategyAbstract.java index ac6d2245423..470a04ea516 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/AllVersionsStrategyAbstract.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/AllVersionsStrategyAbstract.java @@ -36,9 +36,9 @@ public interface AllVersionsStrategyAbstract extends VersioningStrategy String versioningField(); @Value.Default - default VersioningResolver versioningComparator() + default VersionResolver versionResolver() { - return VersioningResolver.DIGEST_BASED; + return VersionResolver.DIGEST_BASED; } @Value.Default diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/MaxVersionStrategyAbstract.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/MaxVersionStrategyAbstract.java index cf45d9c3d17..53fc7d1285d 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/MaxVersionStrategyAbstract.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/MaxVersionStrategyAbstract.java @@ -33,9 +33,9 @@ public interface MaxVersionStrategyAbstract extends VersioningStrategy String versioningField(); @Value.Default - default VersioningResolver versioningComparator() + default VersionResolver versionResolver() { - return VersioningResolver.DIGEST_BASED; + return VersionResolver.DIGEST_BASED; } @Value.Default diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningResolver.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersionResolver.java similarity index 96% rename from legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningResolver.java rename to legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersionResolver.java index b88691dd381..0fa69f05985 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningResolver.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersionResolver.java @@ -14,7 +14,7 @@ package org.finos.legend.engine.persistence.components.ingestmode.versioning; -public enum VersioningResolver +public enum VersionResolver { GREATER_THAN_ACTIVE_VERSION, GREATER_THAN_EQUAL_TO_ACTIVE_VERSION, diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningConditionVisitor.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningConditionVisitor.java index 88e7bdd2921..4906e36a7df 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningConditionVisitor.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-logical-plan/src/main/java/org/finos/legend/engine/persistence/components/ingestmode/versioning/VersioningConditionVisitor.java @@ -59,7 +59,7 @@ public Condition visitMaxVersionStrategy(MaxVersionStrategyAbstract maxVersionSt FieldValue mainVersioningField = FieldValue.builder().datasetRef(mainDataset.datasetReference()).fieldName(maxVersionStrategy.versioningField()).build(); FieldValue stagingVersioningField = FieldValue.builder().datasetRef(stagingDataset.datasetReference()).fieldName(maxVersionStrategy.versioningField()).build(); - switch (maxVersionStrategy.versioningComparator()) + switch (maxVersionStrategy.versionResolver()) { case GREATER_THAN_ACTIVE_VERSION: if (invertComparison) diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-ansi/src/test/java/org/finos/legend/engine/persistence/components/util/LogicalPlanUtilsTest.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-ansi/src/test/java/org/finos/legend/engine/persistence/components/util/LogicalPlanUtilsTest.java index 8ffb213fc5e..f3d2e3473c1 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-ansi/src/test/java/org/finos/legend/engine/persistence/components/util/LogicalPlanUtilsTest.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-ansi/src/test/java/org/finos/legend/engine/persistence/components/util/LogicalPlanUtilsTest.java @@ -38,7 +38,7 @@ import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; -import static org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver.GREATER_THAN_ACTIVE_VERSION; +import static org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver.GREATER_THAN_ACTIVE_VERSION; public class LogicalPlanUtilsTest extends IngestModeTest { @@ -57,7 +57,7 @@ public void testDeduplicateByMaxVersion() RelationalTransformer transformer = new RelationalTransformer(AnsiSqlSink.get()); List primaryKeys = Arrays.asList("id", "name"); - VersioningStrategy versioningStrategy = MaxVersionStrategy.builder().versioningField("version").performVersioning(true).versioningComparator(GREATER_THAN_ACTIVE_VERSION).build(); + VersioningStrategy versioningStrategy = MaxVersionStrategy.builder().versioningField("version").performVersioning(true).versionResolver(GREATER_THAN_ACTIVE_VERSION).build(); Selection selection = (Selection) versioningStrategy.accept(new DatasetDeduplicator(dataset, primaryKeys)); LogicalPlan logicalPlan = LogicalPlan.builder().addOps(selection).build(); SqlPlan physicalPlan = transformer.generatePhysicalPlan(logicalPlan); @@ -87,7 +87,7 @@ public void testDeduplicateByMaxVersionAndFilterDataset() .addDatasetFilters(DatasetFilter.of("biz_date", FilterType.LESS_THAN, "2020-01-03")) .build(); - VersioningStrategy versioningStrategy = MaxVersionStrategy.builder().versioningField("version").performVersioning(true).versioningComparator(GREATER_THAN_ACTIVE_VERSION).build(); + VersioningStrategy versioningStrategy = MaxVersionStrategy.builder().versioningField("version").performVersioning(true).versionResolver(GREATER_THAN_ACTIVE_VERSION).build(); Selection selection = (Selection) versioningStrategy.accept(new DatasetDeduplicator(dataset, primaryKeys)); LogicalPlan logicalPlan = LogicalPlan.builder().addOps(selection).build(); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/bitemporal/BitemporalDeltaWithBatchIdTest.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/bitemporal/BitemporalDeltaWithBatchIdTest.java index 5ad5db3bbec..d4890a69bc0 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/bitemporal/BitemporalDeltaWithBatchIdTest.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/bitemporal/BitemporalDeltaWithBatchIdTest.java @@ -24,7 +24,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.validitymilestoning.derivation.SourceSpecifiesFromAndThruDateTime; import org.finos.legend.engine.persistence.components.ingestmode.validitymilestoning.derivation.SourceSpecifiesFromDateTime; import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition; import org.finos.legend.engine.persistence.components.planner.PlannerOptions; @@ -516,7 +516,7 @@ void testMilestoningSourceSpecifiesFromSet3WithDataSplit() throws Exception .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -598,7 +598,7 @@ void testMilestoningSourceSpecifiesFromSet3WithDataSplitMultiPasses() throws Exc .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -788,7 +788,7 @@ void testMilestoningSourceSpecifiesFromSet5WithDataSplitFilterDuplicates() throw .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -871,7 +871,7 @@ void testMilestoningSourceSpecifiesFromSet5WithDataSplitFilterDuplicatesMultiPas .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -1121,7 +1121,7 @@ void testMilestoningSourceSpecifiesFromWithDeleteIndicatorSet3WithDataSplit() th .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -1202,7 +1202,7 @@ void testMilestoningSourceSpecifiesFromWithDeleteIndicatorSet3WithDataSplitWithM .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -1390,7 +1390,7 @@ void testMilestoningSourceSpecifiesFromWithDeleteIndicatorSet5WithDataSplitFilte .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -1475,7 +1475,7 @@ void testMilestoningSourceSpecifiesFromWithDeleteIndicatorSet5WithDataSplitFilte .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/AppendOnlyTest.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/AppendOnlyTest.java index 7ba0f065464..50f12a59bce 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/AppendOnlyTest.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/AppendOnlyTest.java @@ -27,7 +27,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition; import org.finos.legend.engine.persistence.components.planner.PlannerOptions; @@ -194,7 +194,7 @@ void testAppendOnlyWithAuditingMaxVersionFilterDuplicatesFilterExistingRecordsUp .deduplicationStrategy(FilterDuplicates.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeName).build()) @@ -243,7 +243,7 @@ void testAppendOnlyWithAuditingMaxVersionFilterDuplicatesNoFilterExistingRecords .deduplicationStrategy(FilterDuplicates.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeName).build()) @@ -294,7 +294,7 @@ void testAppendOnlyWithAuditingAllVersionFilterDuplicatesFilterExistingRecords() .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeName).build()) @@ -345,7 +345,7 @@ void testAppendOnlyWithAuditingAllVersionFilterDuplicatesNoFilterExistingRecords .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionName) .dataSplitFieldName(dataSplitName) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeName).build()) diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalDeltaTest.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalDeltaTest.java index 8ed498e9b6c..f8c371a95c0 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalDeltaTest.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalDeltaTest.java @@ -23,7 +23,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.audit.DateTimeAuditing; import org.finos.legend.engine.persistence.components.ingestmode.audit.NoAuditing; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.ingestmode.merge.DeleteIndicatorMergeStrategy; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition; @@ -341,7 +341,7 @@ void testNonTemporalDeltaWithMaxVersioningGreaterThan() throws Exception .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -394,7 +394,7 @@ void testNonTemporalDeltaWithMaxVersioningGreaterThanEqualTo() throws Exception .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -447,7 +447,7 @@ void testNonTemporalDeltaWithMaxVersioningGreaterThanWithDedup() throws Exceptio .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -500,7 +500,7 @@ void testNonTemporalDeltaWithMaxVersioningGreaterThanEqualToWithDedup() throws E .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -605,7 +605,7 @@ void testNonTemporalDeltaWithFilterStagingTableWithMaxVersioningGreaterThan() th .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -661,7 +661,7 @@ void testNonTemporalDeltaWithFilterStagingTableWithMaxVersioningGreaterThanEqual .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -717,7 +717,7 @@ void testNonTemporalDeltaWithFilterStagingTableWithMaxVersioningGreaterThanWithD .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -773,7 +773,7 @@ void testNonTemporalDeltaWithFilterStagingTableWithMaxVersioningGreaterThanEqual .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalSnapshotTest.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalSnapshotTest.java index c29b00b9d8d..6e5e2814a93 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalSnapshotTest.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/nontemporal/NontemporalSnapshotTest.java @@ -22,7 +22,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.audit.NoAuditing; import org.finos.legend.engine.persistence.components.ingestmode.deduplication.FilterDuplicates; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition; import org.finos.legend.engine.persistence.components.planner.PlannerOptions; @@ -265,7 +265,7 @@ void testNontemporalSnapshotWithMaxVersionAndFilterDuplicates() throws Exception // Generate the milestoning object NontemporalSnapshot ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").versioningComparator(VersioningResolver.DIGEST_BASED).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").versionResolver(VersionResolver.DIGEST_BASED).build()) .deduplicationStrategy(FilterDuplicates.builder().build()) .build(); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/unitemporal/UnitemporalDeltaTest.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/unitemporal/UnitemporalDeltaTest.java index efade9fec67..aab156367d8 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/unitemporal/UnitemporalDeltaTest.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/ingestmode/unitemporal/UnitemporalDeltaTest.java @@ -20,7 +20,7 @@ import org.finos.legend.engine.persistence.components.common.OptimizationFilter; import org.finos.legend.engine.persistence.components.ingestmode.UnitemporalDelta; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.ingestmode.merge.DeleteIndicatorMergeStrategy; import org.finos.legend.engine.persistence.components.ingestmode.transactionmilestoning.BatchIdAndDateTime; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; @@ -252,7 +252,7 @@ void testMilestoningWithMaxVersioningGreaterThan() throws Exception .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -312,7 +312,7 @@ void testMilestoningWithMaxVersioningGreaterThanEqualTo() throws Exception .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -372,7 +372,7 @@ void testMilestoningWithMaxVersioningGreaterThanWithDedup() throws Exception .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -432,7 +432,7 @@ void testMilestoningWithMaxVersioningGreaterThanEqualToWithDedup() throws Except .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -558,7 +558,7 @@ void testMilestoningWithFilterStagingTableWithMaxVersioningGreaterThan() throws .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -621,7 +621,7 @@ void testMilestoningWithFilterStagingTableWithMaxVersioningGreaterThanEqualTo() .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -684,7 +684,7 @@ void testMilestoningWithFilterStagingTableWithMaxVersioningGreaterThanWithDedup( .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -747,7 +747,7 @@ void testMilestoningWithFilterStagingTableWithMaxVersioningGreaterThanEqualToWit .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -809,7 +809,7 @@ void testMilestoningWithFilterStagingTableWithMaxVersioningGreaterThanWithDedupW .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(versionName) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -868,7 +868,7 @@ void testMilestoningWithMaxVersioningFail() throws Exception .build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(nameName) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/versioning/TestDedupAndVersioning.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/versioning/TestDedupAndVersioning.java index 19860a5ec5c..3750e353517 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/versioning/TestDedupAndVersioning.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-h2/src/test/java/org/finos/legend/engine/persistence/components/versioning/TestDedupAndVersioning.java @@ -28,7 +28,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.deduplication.FilterDuplicates; import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.logicalplan.datasets.*; import org.finos.legend.engine.persistence.components.relational.api.RelationalIngestor; import org.finos.legend.engine.persistence.components.relational.h2.H2Sink; @@ -124,7 +124,7 @@ void testNoDedupMaxVersioningDoNotPerform() Datasets datasets = Datasets.of(mainTable, stagingTable); IngestMode ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(false).versioningComparator(VersioningResolver.DIGEST_BASED).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(false).versionResolver(VersionResolver.DIGEST_BASED).build()) .build(); performDedupAndVersioining(datasets, ingestMode); @@ -142,7 +142,7 @@ void testNoDedupMaxVersioning() throws Exception IngestMode ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) .deduplicationStrategy(AllowDuplicates.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").versioningComparator(VersioningResolver.DIGEST_BASED).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").versionResolver(VersionResolver.DIGEST_BASED).build()) .build(); createStagingTableWithVersion(); @@ -178,7 +178,7 @@ void testNoDedupAllVersioningDoNotPerform() .auditing(DateTimeAuditing.builder().dateTimeField("append_time").build()) .digestField("digest") .deduplicationStrategy(AllowDuplicates.builder().build()) - .versioningStrategy(AllVersionsStrategy.builder().versioningField("version").performVersioning(false).versioningComparator(VersioningResolver.DIGEST_BASED).build()) + .versioningStrategy(AllVersionsStrategy.builder().versioningField("version").performVersioning(false).versionResolver(VersionResolver.DIGEST_BASED).build()) .build(); performDedupAndVersioining(datasets, ingestMode); @@ -198,7 +198,7 @@ void testNoDedupAllVersion() throws Exception .digestField("digest") .deduplicationStrategy(AllowDuplicates.builder().build()) .versioningStrategy(AllVersionsStrategy.builder().versioningField("version") - .versioningComparator(VersioningResolver.DIGEST_BASED).performVersioning(true).build()) + .versionResolver(VersionResolver.DIGEST_BASED).performVersioning(true).build()) .build(); createStagingTableWithVersion(); @@ -254,7 +254,7 @@ void testFilterDupsMaxVersionDoNotPerform() throws Exception IngestMode ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) .deduplicationStrategy(FilterDuplicates.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(false).versioningComparator(VersioningResolver.DIGEST_BASED).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(false).versionResolver(VersionResolver.DIGEST_BASED).build()) .build(); createStagingTableWithVersion(); @@ -277,7 +277,7 @@ void testFilterDupsMaxVersion() throws Exception IngestMode ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) .deduplicationStrategy(FilterDuplicates.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").versioningComparator(VersioningResolver.DIGEST_BASED).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").versionResolver(VersionResolver.DIGEST_BASED).build()) .build(); createStagingTableWithVersion(); @@ -314,7 +314,7 @@ void testFilterDupsAllVersionDoNotPerform() throws Exception .digestField("digest") .deduplicationStrategy(FilterDuplicates.builder().build()) .versioningStrategy(AllVersionsStrategy.builder().versioningField("version") - .versioningComparator(VersioningResolver.DIGEST_BASED).performVersioning(false).build()) + .versionResolver(VersionResolver.DIGEST_BASED).performVersioning(false).build()) .build(); createStagingTableWithVersion(); @@ -339,7 +339,7 @@ void testFilterDupsAllVersion() throws Exception .digestField("digest") .deduplicationStrategy(FilterDuplicates.builder().build()) .versioningStrategy(AllVersionsStrategy.builder().versioningField("version") - .versioningComparator(VersioningResolver.DIGEST_BASED).performVersioning(true).build()) + .versionResolver(VersionResolver.DIGEST_BASED).performVersioning(true).build()) .build(); createStagingTableWithVersion(); @@ -401,7 +401,7 @@ void testFailOnDupsMaxVersionDoNotPerform() throws Exception IngestMode ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) .deduplicationStrategy(FailOnDuplicates.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(false).versioningComparator(VersioningResolver.DIGEST_BASED).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(false).versionResolver(VersionResolver.DIGEST_BASED).build()) .build(); // Happy scenario @@ -439,7 +439,7 @@ void testFailOnDupsMaxVersion() throws Exception IngestMode ingestMode = NontemporalSnapshot.builder() .auditing(NoAuditing.builder().build()) .deduplicationStrategy(FailOnDuplicates.builder().build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(true).versioningComparator(VersioningResolver.DIGEST_BASED).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("version").performVersioning(true).versionResolver(VersionResolver.DIGEST_BASED).build()) .build(); // Happy scenario @@ -480,7 +480,7 @@ void testFailOnDupsAllVersionDoNotPerform() throws Exception .digestField("digest") .deduplicationStrategy(FailOnDuplicates.builder().build()) .versioningStrategy(AllVersionsStrategy.builder().versioningField("version") - .versioningComparator(VersioningResolver.DIGEST_BASED).performVersioning(false).build()) + .versionResolver(VersionResolver.DIGEST_BASED).performVersioning(false).build()) .build(); // Happy scenario @@ -520,7 +520,7 @@ void testFailOnDupsAllVersion() throws Exception .digestField("digest") .deduplicationStrategy(FailOnDuplicates.builder().build()) .versioningStrategy(AllVersionsStrategy.builder().versioningField("version") - .versioningComparator(VersioningResolver.DIGEST_BASED).performVersioning(true).build()) + .versionResolver(VersionResolver.DIGEST_BASED).performVersioning(true).build()) .build(); // Happy scenario diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/AppendOnlyScenarios.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/AppendOnlyScenarios.java index 3d6e5b484cf..3fb1bf87a4d 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/AppendOnlyScenarios.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/AppendOnlyScenarios.java @@ -24,7 +24,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; public class AppendOnlyScenarios extends BaseTest { @@ -127,7 +127,7 @@ public TestScenario FAIL_ON_DUPLICATES_WITH_AUDITING_ALL_VERSION_NO_FILTER_EXIST .versioningStrategy(AllVersionsStrategy.builder() .versioningField(bizDateField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeField).build()) @@ -145,7 +145,7 @@ public TestScenario FILTER_DUPLICATES_NO_AUDITING_ALL_VERSION_NO_FILTER_EXISTING .versioningStrategy(AllVersionsStrategy.builder() .versioningField(bizDateField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(NoAuditing.builder().build()) @@ -162,7 +162,7 @@ public TestScenario FILTER_DUPLICATES_WITH_AUDITING_ALL_VERSION_WITH_FILTER_EXIS .versioningStrategy(AllVersionsStrategy.builder() .versioningField(bizDateField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeField).build()) @@ -178,7 +178,7 @@ public TestScenario FAIL_ON_DUPLICATES_WITH_AUDITING_MAX_VERSION_WITH_FILTER_EXI .deduplicationStrategy(FailOnDuplicates.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(bizDateField) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeField).build()) @@ -194,7 +194,7 @@ public TestScenario FILTER_DUPLICATES_WITH_AUDITING_MAX_VERSION_NO_FILTER_EXISTI .deduplicationStrategy(FilterDuplicates.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(bizDateField) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(true) .build()) .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeField).build()) diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromAndThroughScenarios.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromAndThroughScenarios.java index 6e0f1e0dca8..40ad0c0725f 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromAndThroughScenarios.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromAndThroughScenarios.java @@ -23,7 +23,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.validitymilestoning.ValidDateTime; import org.finos.legend.engine.persistence.components.ingestmode.validitymilestoning.derivation.SourceSpecifiesFromAndThruDateTime; import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition; import org.finos.legend.engine.persistence.components.logicalplan.datasets.SchemaDefinition; @@ -74,7 +74,7 @@ public TestScenario BATCH_ID_AND_TIME_BASED__NO_DEL_IND__WITH_DATA_SPLITS() .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchIdAndDateTime.builder() @@ -126,7 +126,7 @@ public TestScenario DATETIME_BASED__WITH_DEL_IND__WITH_DATA_SPLITS() .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(TransactionDateTime.builder() diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromOnlyScenarios.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromOnlyScenarios.java index 7ce7de4e572..ec04a184c47 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromOnlyScenarios.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/BitemporalDeltaSourceSpecifiesFromOnlyScenarios.java @@ -24,7 +24,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.validitymilestoning.ValidDateTime; import org.finos.legend.engine.persistence.components.ingestmode.validitymilestoning.derivation.SourceSpecifiesFromDateTime; import org.finos.legend.engine.persistence.components.ingestmode.versioning.AllVersionsStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.logicalplan.datasets.Dataset; import org.finos.legend.engine.persistence.components.logicalplan.datasets.DatasetDefinition; import org.finos.legend.engine.persistence.components.logicalplan.datasets.SchemaDefinition; @@ -89,7 +89,7 @@ public TestScenario BATCH_ID_BASED__NO_DEL_IND__WITH_DATA_SPLITS() .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -151,7 +151,7 @@ public TestScenario BATCH_ID_BASED__WITH_DEL_IND__WITH_DATA_SPLITS__USING_DEFAUL .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -207,7 +207,7 @@ public TestScenario BATCH_ID_BASED__NO_DEL_IND__WITH_DATA_SPLITS__FILTER_DUPLICA .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() @@ -287,7 +287,7 @@ public TestScenario BATCH_ID_BASED__WITH_DEL_IND__WITH_DATA_SPLITS__FILTER_DUPLI .versioningStrategy(AllVersionsStrategy.builder() .versioningField(versionField) .dataSplitFieldName(dataSplitField) - .versioningComparator(VersioningResolver.DIGEST_BASED) + .versionResolver(VersionResolver.DIGEST_BASED) .performVersioning(false) .build()) .transactionMilestoning(BatchId.builder() diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NonTemporalDeltaScenarios.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NonTemporalDeltaScenarios.java index 56ce3235708..13cc1e59a32 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NonTemporalDeltaScenarios.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NonTemporalDeltaScenarios.java @@ -23,7 +23,7 @@ import java.util.Optional; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.ingestmode.merge.DeleteIndicatorMergeStrategy; public class NonTemporalDeltaScenarios extends BaseTest @@ -106,7 +106,7 @@ public TestScenario MAX_VERSIONING_WITH_GREATER_THAN__DEDUP__WITH_STAGING_FILTER .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(version.name()) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); @@ -120,7 +120,7 @@ public TestScenario MAX_VERSIONING_WITH_GREATER_THAN__NO_DEDUP__WITH_STAGING_FIL .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(version.name()) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -134,7 +134,7 @@ public TestScenario MAX_VERSIONING_WITH_GREATER_THAN__NO_DEDUP__WITHOUT_STAGING_ .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(version.name()) - .versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION) .performVersioning(false) .build()) .build(); @@ -148,7 +148,7 @@ public TestScenario MAX_VERSIONING_WITH_GREATER_THAN_EQUAL__DEDUP__WITHOUT_STAGI .auditing(NoAuditing.builder().build()) .versioningStrategy(MaxVersionStrategy.builder() .versioningField(version.name()) - .versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) + .versionResolver(VersionResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION) .performVersioning(true) .build()) .build(); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NontemporalSnapshotTestScenarios.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NontemporalSnapshotTestScenarios.java index 0afe9950af0..d2a75c5475a 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NontemporalSnapshotTestScenarios.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/NontemporalSnapshotTestScenarios.java @@ -22,7 +22,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.deduplication.FilterDuplicates; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; public class NontemporalSnapshotTestScenarios extends BaseTest { @@ -63,7 +63,7 @@ public TestScenario WITH_AUDTING__FAIL_ON_DUP_MAX_VERSIONING() { NontemporalSnapshot ingestMode = NontemporalSnapshot.builder() .auditing(DateTimeAuditing.builder().dateTimeField(batchUpdateTimeField).build()) - .versioningStrategy(MaxVersionStrategy.builder().versioningField("biz_date").versioningComparator(VersioningResolver.DIGEST_BASED).build()) + .versioningStrategy(MaxVersionStrategy.builder().versioningField("biz_date").versionResolver(VersionResolver.DIGEST_BASED).build()) .deduplicationStrategy(FailOnDuplicates.builder().build()) .build(); return new TestScenario(mainTableWithBaseSchemaHavingAuditField, stagingTableWithBaseSchema, ingestMode); diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/UnitemporalDeltaBatchIdBasedScenarios.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/UnitemporalDeltaBatchIdBasedScenarios.java index 76674e7d7f5..21c7186b93f 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/UnitemporalDeltaBatchIdBasedScenarios.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-component/legend-engine-xt-persistence-component-relational-test/src/test/java/org/finos/legend/engine/persistence/components/scenarios/UnitemporalDeltaBatchIdBasedScenarios.java @@ -19,7 +19,7 @@ import org.finos.legend.engine.persistence.components.ingestmode.UnitemporalDelta; import org.finos.legend.engine.persistence.components.ingestmode.versioning.MaxVersionStrategy; import org.finos.legend.engine.persistence.components.ingestmode.versioning.NoVersioningStrategy; -import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersioningResolver; +import org.finos.legend.engine.persistence.components.ingestmode.versioning.VersionResolver; import org.finos.legend.engine.persistence.components.ingestmode.merge.DeleteIndicatorMergeStrategy; import org.finos.legend.engine.persistence.components.ingestmode.transactionmilestoning.BatchId; @@ -181,7 +181,7 @@ public TestScenario BATCH_ID_BASED__MAX_VERSIONING_WITH_GREATER_THAN__DEDUP__WIT .batchIdInName(batchIdInField) .batchIdOutName(batchIdOutField) .build()) - .versioningStrategy(MaxVersionStrategy.builder().performVersioning(true).versioningField(version.name()).versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION).build()) + .versioningStrategy(MaxVersionStrategy.builder().performVersioning(true).versioningField(version.name()).versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION).build()) .build(); return new TestScenario(mainTableWithBatchIdAndVersionBasedSchema, stagingTableWithFilterAndVersion, ingestMode); } @@ -194,7 +194,7 @@ public TestScenario BATCH_ID_BASED__MAX_VERSIONING_WITH_GREATER_THAN__NO_DEDUP__ .batchIdInName(batchIdInField) .batchIdOutName(batchIdOutField) .build()) - .versioningStrategy(MaxVersionStrategy.builder().performVersioning(false).versioningField(version.name()).versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION).build()) + .versioningStrategy(MaxVersionStrategy.builder().performVersioning(false).versioningField(version.name()).versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION).build()) .build(); return new TestScenario(mainTableWithBatchIdAndVersionBasedSchema, stagingTableWithFilterAndVersion, ingestMode); } @@ -207,7 +207,7 @@ public TestScenario BATCH_ID_BASED__MAX_VERSIONING_WITH_GREATER_THAN__NO_DEDUP__ .batchIdInName(batchIdInField) .batchIdOutName(batchIdOutField) .build()) - .versioningStrategy(MaxVersionStrategy.builder().performVersioning(false).versioningField(version.name()).versioningComparator(VersioningResolver.GREATER_THAN_ACTIVE_VERSION).build()) + .versioningStrategy(MaxVersionStrategy.builder().performVersioning(false).versioningField(version.name()).versionResolver(VersionResolver.GREATER_THAN_ACTIVE_VERSION).build()) .build(); return new TestScenario(mainTableWithBatchIdAndVersionBasedSchema, stagingTableWithVersion, ingestMode); } @@ -220,7 +220,7 @@ public TestScenario BATCH_ID_BASED__MAX_VERSIONING_WITH_GREATER_THAN_EQUAL__DEDU .batchIdInName(batchIdInField) .batchIdOutName(batchIdOutField) .build()) - .versioningStrategy(MaxVersionStrategy.builder().performVersioning(true).versioningField(version.name()).versioningComparator(VersioningResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION).build()) + .versioningStrategy(MaxVersionStrategy.builder().performVersioning(true).versioningField(version.name()).versionResolver(VersionResolver.GREATER_THAN_EQUAL_TO_ACTIVE_VERSION).build()) .build(); return new TestScenario(mainTableWithBatchIdAndVersionBasedSchema, stagingTableWithVersion, ingestMode); }