Skip to content
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

Server endpoints v2 returning the checkpoins data of a partitioning: 190 #194

Merged
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
8733ffd
Fixes #189 - Define and implemented a db function to return the check…
TebaleloS Apr 19, 2024
d211bd8
Fixes #189 - Modifying a db function
TebaleloS Apr 19, 2024
4dd02f1
Fixes #189 - Modifying a db function
TebaleloS Apr 19, 2024
eea41f4
Fixes #189 - Adding test cases
TebaleloS Apr 19, 2024
1baac16
Fixes #189 - Added two input fields to the db function
TebaleloS Apr 22, 2024
e2c61d1
Fixes #189 - Fixing type mismatch
TebaleloS Apr 23, 2024
388492a
Testing #120 db integration
TebaleloS Apr 25, 2024
c386aec
merging changes from master
TebaleloS Apr 29, 2024
b3fc2bb
Fixes #189 - Adding test cases
TebaleloS Apr 30, 2024
6edc40a
Fixes #189 - Changing back the details of flows.flows
TebaleloS Apr 30, 2024
6c9be0c
Fixes #189 - Implementing GitHub comments
TebaleloS Apr 30, 2024
97f7269
Merge branch 'master' into feature/#190-Server-endpoints-v2-returning…
TebaleloS May 6, 2024
6c2c99d
Fixes #190 - defined the dto to submit
TebaleloS May 7, 2024
b315d4e
Merge branch 'master' into feature/#190-Server-endpoints-v2-returning…
TebaleloS May 7, 2024
dba7d34
Update V1.7.1__flows.alter.ddl
TebaleloS May 7, 2024
7f976e0
Delete database/src/main/postgres/runs/V1.8.3__get_partitioning_check…
TebaleloS May 7, 2024
c39dbe0
Update GetPartitioningMeasuresTest.scala
TebaleloS May 7, 2024
814b0ce
Delete database/src/test/scala/za/co/absa/atum/database/runs/GetParti…
TebaleloS May 7, 2024
f4bdfec
Fixees #190 - Merging master and Added GetPartitioningCheckpoints cla…
TebaleloS May 8, 2024
bf22aa0
Fixees #190 - Added checkpoint query resultDTO, GetPartitioningCheckp…
TebaleloS May 8, 2024
f301d3f
Fixes #190 - implementing get checkpoints functionality in the reposi…
TebaleloS May 8, 2024
59602ac
Fixes #190 - renamed CheckpointDTO to CheckpointSubmitDTO
TebaleloS May 8, 2024
91099fa
Fixes #190 - Implementing partitioningCheckpoint service
TebaleloS May 8, 2024
98fe612
Fixes #190 - Implementing partitioningCheckpoint in the partitioning …
TebaleloS May 9, 2024
0335ab9
Fixes #190 - Implementing partitioningCheckpoint in the partitioning …
TebaleloS May 9, 2024
888f455
Fixes #190 - fixing controller
TebaleloS May 9, 2024
9788148
Fixes #190 - updating current branch
TebaleloS May 9, 2024
d7d891d
Fixes #190 - Adding layers
TebaleloS May 9, 2024
4411518
Fixes #190 - Adding doobie implicit
TebaleloS May 9, 2024
2e39dac
Fixes #190 - Fixing the build
TebaleloS May 9, 2024
fc046bf
Fixes #190 - removing unwanted layer from checkpoint repository
TebaleloS May 9, 2024
0ae9521
Fixes #190 - adding mock layer from PartitioningRepositorySpec
TebaleloS May 9, 2024
1c79638
Fixes #190 - adding the implicits for the added dto's and defining th…
TebaleloS May 9, 2024
347b405
Fixes #190 - defining current version
TebaleloS May 9, 2024
56b7761
Fixes #190 - Fixing type mismatch
TebaleloS May 9, 2024
cf896e8
Fixes #190 - Implementing DTO instances
TebaleloS May 9, 2024
eb57626
Fixes #190 - Implementing DTO instances
TebaleloS May 9, 2024
45eaaca
Fixes #190 - adding CheckpointMeasurements model
TebaleloS May 14, 2024
eadedad
Fixes #190 - adding CheckpointMeasurements test
TebaleloS May 14, 2024
d581b8e
Read[CheckpointMeasurements]
salamonpavel May 14, 2024
f0f0b77
Saving changes
TebaleloS May 14, 2024
97ea270
Fixes #190 - Read[CheckpointMeasurements] test
TebaleloS May 14, 2024
35b1d97
Fixes #190 - transforming CheckpointMeasurements to CheckpointDTO
TebaleloS May 17, 2024
f905e45
Removing test file
TebaleloS May 17, 2024
d22afd2
removing default values on output
TebaleloS May 17, 2024
3c79a68
partitioning checkpoint test
TebaleloS May 22, 2024
4c8c30c
partitioning checkpoint test repository
TebaleloS May 23, 2024
45e98da
partitioning checkpoint test for service
TebaleloS May 23, 2024
3f9fd40
partitioning checkpoint test controller
TebaleloS May 23, 2024
c095a50
partitioning checkpoint test controller
TebaleloS May 23, 2024
25b276d
removed the mapError from getPartitioningCheckpoints
TebaleloS May 23, 2024
791d018
Fixing getPartitioningCheckpoints test and implements GitHub suggestions
TebaleloS May 23, 2024
a4c521a
Fixing merging conflicts
TebaleloS May 24, 2024
9cb52a5
Fixing merging conflicts
TebaleloS May 24, 2024
3c66d0d
Removing unused import
TebaleloS May 24, 2024
4d50abf
merge master
TebaleloS May 28, 2024
12d3912
implementing GitHub comments
TebaleloS May 28, 2024
5c3f8b9
implementing GitHub comments in service
TebaleloS May 28, 2024
609d9d2
implementing GitHub comments
TebaleloS May 28, 2024
7ade768
Merge branch 'master' into feature/#190-Server-endpoints-v2-returning…
TebaleloS May 30, 2024
46da906
Fixing the build
TebaleloS May 30, 2024
f5e3d4c
Fixing V1.8.3__get_partitioning_checkpoints.sql fields
TebaleloS May 31, 2024
6d8cbe3
Fixing service test cases
TebaleloS Jun 3, 2024
29b9e31
Fixing measure_columns to measured_columns
TebaleloS Jun 4, 2024
80f86af
Changing from object CheckpointFromDBObject to CheckpointFromDB
TebaleloS Jun 5, 2024
b591397
Changing from object CheckpointFromDBObject to CheckpointFromDB
TebaleloS Jun 5, 2024
a44a681
Merge branch 'master' into feature/#190-Server-endpoints-v2-returning…
TebaleloS Jun 5, 2024
c16df3c
Defining partitioningJson in a common way
TebaleloS Jun 7, 2024
55b83bf
Merge branch 'feature/#190-Server-endpoints-v2-returning-the-checkpoi…
TebaleloS Jun 7, 2024
b6b35b6
Implementing GitHub comments
TebaleloS Jun 11, 2024
ca79884
Merge branch 'master' into feature/#190-Server-endpoints-v2-returning…
TebaleloS Jun 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions database/src/main/postgres/flows/V1.7.1__flows.alter.ddl
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@

ALTER TABLE flows.flows
ADD COLUMN IF NOT EXISTS fk_primary_partitioning BIGINT;

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CREATE OR REPLACE FUNCTION flows.get_flow_checkpoints(
OUT id_checkpoint UUID,
OUT checkpoint_name TEXT,
OUT measure_name TEXT,
OUT measure_columns TEXT[],
OUT measured_columns TEXT[],
OUT measurement_value JSONB,
OUT checkpoint_start_time TIMESTAMP WITH TIME ZONE,
OUT checkpoint_end_time TIMESTAMP WITH TIME ZONE
Expand Down Expand Up @@ -58,7 +58,7 @@ $$
-- id_checkpoint - id of retrieved checkpoint
-- checkpoint_name - name of retrieved checkpoint
-- measure_name - measure name associated with a given checkpoint
-- measure_columns - measure columns associated with a given checkpoint
-- measured_columns - measure columns associated with a given checkpoint
-- measurement_value - measurement details associated with a given checkpoint
-- checkpoint_time - time
--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ CREATE OR REPLACE FUNCTION runs.get_partitioning_checkpoints(
OUT status_text TEXT,
OUT id_checkpoint UUID,
OUT checkpoint_name TEXT,
OUT author TEXT,
OUT measured_by_atum_agent BOOLEAN,
OUT measure_name TEXT,
OUT measure_columns TEXT[],
OUT measured_columns TEXT[],
OUT measurement_value JSONB,
OUT checkpoint_start_time TIMESTAMP WITH TIME ZONE,
OUT checkpoint_end_time TIMESTAMP WITH TIME ZONE
Expand All @@ -37,16 +39,18 @@ $$
-- given partitioning (and checkpoint name, if specified).
--
-- Parameters:
-- i_partitioning - partitioning of requested checkpoints
-- i_partitioning - partitioning of requested checkpoints
-- i_limit - (optional) maximum number of checkpoint's measurements to return
-- if 0 specified, all data will be returned, i.e. no limit will be applied
-- i_checkpoint_name - (optional) if specified, returns data related to particular checkpoint's name
--
-- Returns:
-- i_checkpoint_name - (optional) if specified, returns data related to particular checkpoint's name
-- status - Status code
-- status_text - Status message
-- id_checkpoint - ID of the checkpoint
-- checkpoint_name - Name of the checkpoint
-- author - Author of the checkpoint
-- measuredByAtumAgent - Flag indicating whether the checkpoint was measured by ATUM agent
-- measure_name - Name of the measure
-- measure_columns - Columns of the measure
-- measurement_value - Value of the measurement
Expand Down Expand Up @@ -74,26 +78,28 @@ BEGIN
SELECT
11 AS status,
'Ok' AS status_text,
c.id_checkpoint,
c.checkpoint_name,
C.id_checkpoint,
C.checkpoint_name,
C.created_by AS author,
C.measured_by_atum_agent,
md.measure_name,
md.measured_columns,
m.measurement_value,
c.process_start_time AS checkpoint_start_time,
c.process_end_time AS checkpoint_end_time
M.measurement_value,
C.process_start_time AS checkpoint_start_time,
C.process_end_time AS checkpoint_end_time
FROM
runs.checkpoints c
runs.checkpoints C
JOIN
runs.measurements m ON c.id_checkpoint = m.fk_checkpoint
runs.measurements M ON C.id_checkpoint = M.fk_checkpoint
JOIN
runs.measure_definitions md ON m.fk_measure_definition = md.id_measure_definition
runs.measure_definitions MD ON M.fk_measure_definition = MD.id_measure_definition
WHERE
c.fk_partitioning = _fk_partitioning
C.fk_partitioning = _fk_partitioning
AND
(i_checkpoint_name IS NULL OR c.checkpoint_name = i_checkpoint_name)
(i_checkpoint_name IS NULL OR C.checkpoint_name = i_checkpoint_name)
ORDER BY
c.process_start_time,
c.id_checkpoint
C.process_start_time,
C.id_checkpoint
LIMIT nullif(i_limit, 0);

END;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class GetFlowCheckpointsIntegrationTests extends DBTestSuite {

val measure1 = MeasuredDetails(
row1.getString("measure_name").get,
row1.getArray[String]("measure_columns").map(_.toList).get,
row1.getArray[String]("measured_columns").map(_.toList).get,
row1.getJsonB("measurement_value").get
)

Expand All @@ -248,7 +248,7 @@ class GetFlowCheckpointsIntegrationTests extends DBTestSuite {

val measure2 = MeasuredDetails(
row2.getString("measure_name").get,
row2.getArray[String]("measure_columns").map(_.toList).get,
row2.getArray[String]("measured_columns").map(_.toList).get,
row2.getJsonB("measurement_value").get
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,21 @@ class CreateOrUpdateAdditionalDataIntegrationTests extends DBTestSuite{
assert(table("runs.additional_data").count(add("fk_partitioning", fkPartitioning)) == 5)
assert(table("runs.additional_data_history").count(add("fk_partitioning", fkPartitioning)) == 0)

val expectedDataInAdTable = Seq(
("PrimaryOwner", "TechnicalManagerX", "Bot"),
("SecondaryOwner", "AnalystY", "Bot"),
("SomeNewKey", "SomeNewValue", "MikeRusty"),
("IsDatasetInHDFS", "true", "MikeRusty"),
("DatasetContentSensitivityLevel", "1", "MikeRusty"),
)
expectedDataInAdTable.foreach { case (adNameExp, adValExp, adCreatedByExp) =>
table("runs.additional_data").where(add("ad_name", adNameExp)) {
resultSet =>
val row = resultSet.next()
assert(row.getString("ad_value").contains(adValExp))
assert(row.getString("created_by").contains(adCreatedByExp))
}
}
val expectedDataInAdTable = Seq(
("PrimaryOwner", "TechnicalManagerX", "Bot"),
("SecondaryOwner", "AnalystY", "Bot"),
("SomeNewKey", "SomeNewValue", "MikeRusty"),
("IsDatasetInHDFS", "true", "MikeRusty"),
("DatasetContentSensitivityLevel", "1", "MikeRusty"),
)
expectedDataInAdTable.foreach { case (adNameExp, adValExp, adCreatedByExp) =>
table("runs.additional_data").where(add("ad_name", adNameExp)) {
resultSet =>
val row = resultSet.next()
assert(row.getString("ad_value").contains(adValExp))
assert(row.getString("created_by").contains(adCreatedByExp))
}
}
}

test("Partitioning and AD present, but no new AD records were backed-up or inserted, no changes detected") {
Expand Down
Loading
Loading