-
Notifications
You must be signed in to change notification settings - Fork 1
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
#303: Get flow checkpoints refactoring #304
#303: Get flow checkpoints refactoring #304
Conversation
Release notes:
|
JaCoCo model module code coverage report - scala 2.13.11
|
JaCoCo agent module code coverage report - scala 2.13.11
|
JaCoCo reader module code coverage report - scala 2.13.11
|
JaCoCo server module code coverage report - scala 2.13.11
|
database/src/main/postgres/flows/V0.3.0.1__get_flow_checkpoints.sql
Outdated
Show resolved
Hide resolved
database/src/main/postgres/flows/V0.3.0.1__get_flow_checkpoints.sql
Outdated
Show resolved
Hide resolved
database/src/main/postgres/flows/V0.3.0.1__get_flow_checkpoints.sql
Outdated
Show resolved
Hide resolved
model/src/main/scala/za/co/absa/atum/model/dto/CheckpointWithPartitioningDTO.scala
Show resolved
Hide resolved
server/src/main/scala/za/co/absa/atum/server/model/CheckpointItemWithPartitioningFromDB.scala
Outdated
Show resolved
Hide resolved
server/src/main/scala/za/co/absa/atum/server/model/CheckpointItemWithPartitioningFromDB.scala
Outdated
Show resolved
Hide resolved
|
||
object CheckpointItemWithPartitioningFromDB { | ||
|
||
private def fromItemsToCheckpointWithPartitioningDTO( |
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.
Name suggestion:
Wouldn't be def groupCheckpoint
be easier to understand?
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.
I don't know. Naming is difficult...
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.
That's true 😄
server/src/main/scala/za/co/absa/atum/server/model/CheckpointItemWithPartitioningFromDB.scala
Outdated
Show resolved
Hide resolved
server/src/main/scala/za/co/absa/atum/server/model/CheckpointItemWithPartitioningFromDB.scala
Show resolved
Hide resolved
Co-authored-by: David Benedeki <[email protected]>
…-refactoring' into feature/303-get-flow-checkpoints-refactoring
…temWithPartitioningFromDB.scala Co-authored-by: David Benedeki <[email protected]>
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.
- code reviewed
- pulled
- built
- run
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.
Looks good to me.
checkpointStartTime: ZonedDateTime, | ||
checkpointEndTime: Option[ZonedDateTime], | ||
idPartitioning: Long, | ||
partitioning: Json, |
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.
possibly add code comment similar to the one above (the one on measurementValue
)
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.
Ok, added ...
runs.measure_definitions MD ON M.fk_measure_definition = MD.id_measure_definition | ||
INNER JOIN | ||
runs.partitionings P ON LC.fk_partitioning = P.id_partitioning | ||
ORDER BY LC.process_start_time DESC; |
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.
ORDER BY LC.process_start_time DESC; | |
ORDER BY | |
CASE WHEN i_latest_first THEN LC.process_start_time DESC | |
ELSE LC.process_start_time ASC | |
END; |
potentially this should work (pseudo-code, I haven't run it), also this solution would need to introduce 1 more input parameter i_latest_first
(can be an optional parameter that is true
by default) to the function and make change above on line 135
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.
also, don't we want to make checkpoints closer together by changing this ORDER BY to also contain checkpoint ID in it?
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.
I think it doesn't really matter since we need to process the data on the server anyway.
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.
Ok, added conditional ordering ...
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.
I fundamentally don't see any problem with this PR apart from the minor comments currently on it
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.
Good job!
@@ -91,3 +91,4 @@ utils/resources/*.conf | |||
/server/certs/ | |||
/server/selfsigned.crt | |||
/server/selfsigned.p12 | |||
/.bloop/ |
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.
❓😉
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.
I don't know which plugin/tool does that but there was .bloop folder generated which I believe shouldn't be part of VCS.
WHEN i_latest_first THEN C.process_start_time | ||
END DESC, | ||
CASE | ||
WHEN NOT i_latest_first THEN C.process_start_time | ||
END ASC |
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.
This is tricky on NULL.
Would use an ELSE statement. And probably flip them. So the default is still DESC
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.
Or just use a local variable at the beginning
_latest_first := coalesce(i_latest_first, TRUE);
CASE | ||
WHEN i_latest_first THEN LC.process_start_time | ||
END DESC, | ||
CASE | ||
WHEN NOT i_latest_first THEN LC.process_start_time | ||
END ASC; |
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.
Ditto.
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.
used the coalesce
Refactoring of get flow checkpoints endpoint. It newly returns also partitioning data and is sorted in descending order by checkpoint start time.
Closes #303
Release notes: