diff --git a/scenarios/monitoring/cdp_monitoring/query_samples/README.md b/scenarios/monitoring/cdp_monitoring/query_samples/README.md new file mode 100644 index 00000000..92139ca0 --- /dev/null +++ b/scenarios/monitoring/cdp_monitoring/query_samples/README.md @@ -0,0 +1,6 @@ +This document is a list of query samples for each tables of cdp_monitoring database. + +| # | file | reference table | description | result | +|----|----|----|----|----| +| 1 | [parent_segment_list.sql](parent_segment_list.sql) | cdp_monitoring.parent_segments_configuration | extract a list of Parent Segment with cretedby and updatedby | | +| 2 | [entity_list_per_parent_segment.sql](entity_list_per_parent_segment.sql)| cdp_monitoring.entities| extract a list of entity per Parent Segment | ![](images/2.png) | diff --git a/scenarios/monitoring/cdp_monitoring/query_samples/entity_list_per_parent_segment.sql b/scenarios/monitoring/cdp_monitoring/query_samples/entity_list_per_parent_segment.sql new file mode 100644 index 00000000..4335e19f --- /dev/null +++ b/scenarios/monitoring/cdp_monitoring/query_samples/entity_list_per_parent_segment.sql @@ -0,0 +1,7 @@ +select + JSON_EXTRACT_SCALAR(JSON_PARSE(attributes), '$.audienceId') as parent_segment_id, + id, + JSON_EXTRACT_SCALAR(JSON_PARSE(attributes), '$.name') as name, + type +from entities +order by 1, 2 \ No newline at end of file diff --git a/scenarios/monitoring/cdp_monitoring/query_samples/images/2.png b/scenarios/monitoring/cdp_monitoring/query_samples/images/2.png new file mode 100644 index 00000000..eb95a3cc Binary files /dev/null and b/scenarios/monitoring/cdp_monitoring/query_samples/images/2.png differ diff --git a/scenarios/monitoring/cdp_monitoring/query_samples/parent_segment_list.sql b/scenarios/monitoring/cdp_monitoring/query_samples/parent_segment_list.sql new file mode 100644 index 00000000..1aa4c10f --- /dev/null +++ b/scenarios/monitoring/cdp_monitoring/query_samples/parent_segment_list.sql @@ -0,0 +1,5 @@ +select + id, name, + JSON_EXTRACT_SCALAR(JSON_PARSE(createdby), '$.name') as createdby, + JSON_EXTRACT_SCALAR(JSON_PARSE(updatedby), '$.name') as updatedby +from parent_segments_configuration \ No newline at end of file