-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Draft] Persistence Component: Separating out Partitioning from Unitemporal Snapshot milestoning #3317
base: master
Are you sure you want to change the base?
[Draft] Persistence Component: Separating out Partitioning from Unitemporal Snapshot milestoning #3317
Conversation
…napshot milestoning
…estoning schemes + logic for unitemporal snapshot with partition without digest
…m/rengam32/legend-engine into unitemp-snap-partition-delete-all
|
||
List<Condition> whereClauseForPartition = new ArrayList<>((Arrays.asList(openRecordCondition, notExistsWhereClause))); | ||
if (!(partitioning.isPresent() && partitioning.get().deleteStrategy() == DeleteStrategy.DELETE_ALL)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor to interfaces instead of enum?
if (unitemporalSnapshot.digestField().isPresent()) | ||
{ | ||
return Optional.of(unitemporalSnapshot | ||
.digestField().get()); | ||
} | ||
return Optional.empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (unitemporalSnapshot.digestField().isPresent()) | |
{ | |
return Optional.of(unitemporalSnapshot | |
.digestField().get()); | |
} | |
return Optional.empty(); | |
return unitemporalSnapshot.digestField(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this in my branch
if (unitemporalDelta.digestField().isPresent()) | ||
{ | ||
return Optional.of(unitemporalDelta | ||
.digestField().get()); | ||
} | ||
return Optional.empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (unitemporalDelta.digestField().isPresent()) | |
{ | |
return Optional.of(unitemporalDelta | |
.digestField().get()); | |
} | |
return Optional.empty(); | |
return unitemporalDelta.digestField(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this in my branch
if (bitemporalSnapshot.digestField().isPresent()) | ||
{ | ||
return Optional.of(bitemporalSnapshot | ||
.digestField().get()); | ||
} | ||
return Optional.empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (bitemporalSnapshot.digestField().isPresent()) | |
{ | |
return Optional.of(bitemporalSnapshot | |
.digestField().get()); | |
} | |
return Optional.empty(); | |
return bitemporalSnapshot.digestField(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this in my branch
if (bitemporalDelta.digestField().isPresent()) | ||
{ | ||
return Optional.of(bitemporalDelta | ||
.digestField().get()); | ||
} | ||
return Optional.empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (bitemporalDelta.digestField().isPresent()) | |
{ | |
return Optional.of(bitemporalDelta | |
.digestField().get()); | |
} | |
return Optional.empty(); | |
return bitemporalDelta.digestField(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this in my branch
@Value.Default | ||
default boolean failOnDuplicatePrimaryKeys() | ||
{ | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for adding this? failOnDuplicatePrimaryKeys is a concept under NoVersioning, which seems independent of partitioning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this in my branch
if (digestField.isPresent()) | ||
{ | ||
remainingCols = Arrays.asList(digestField.get()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to have an else block to actually return the remaining columns (i.e. data columns)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this in my branch
.condition(And.of(whereClauseForNotInSink)) | ||
.addFields(FieldValue.builder().datasetRef(mainDataset().datasetReference()).fieldName(ingestMode().digestField()).build()) | ||
.build())); | ||
FieldValue.builder().datasetRef(stagingDataset().datasetReference()).fieldName(ingestMode().digestField().get()).build(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use .orElseThrow in these places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this in my branch
Selection.builder() | ||
.source(mainDataset()) | ||
.condition(And.of(whereClauseForNotInSink)) | ||
.addFields(FieldValue.builder().datasetRef(mainDataset().datasetReference()).fieldName(ingestMode().digestField().get()).build()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use .orElseThrow in these places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this in my branch
if (digestField.isPresent()) | ||
{ | ||
this.digestMatchCondition = LogicalPlanUtils.getDigestMatchCondition(mainDataset(), stagingDataset(), transactionMilestoned.digestField().get()); | ||
this.primaryKeysMatchCondition = LogicalPlanUtils.getPrimaryKeyMatchCondition(mainDataset(), stagingDataset(), primaryKeys.toArray(new String[0])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppose this is a mistake? primaryKeysMatchCondition should be initialized with or without digest - correcting this in my branch
if (digestField.isPresent()) | ||
{ | ||
remainingCols = Arrays.asList(digestField.get()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this in my branch
What type of PR is this?
Improvement
What does this PR do / why is it needed ?
Introducing new interfaces for Partitioning and abstracting it out from Unitemporal Snapshot milestoning.
Which issue(s) this PR fixes:
None
Other notes for reviewers:
Does this PR introduce a user-facing change?
No