Skip to content

Commit

Permalink
add query_samples for cpd_monitoring database
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuu Ohmura committed Oct 11, 2024
1 parent f1c75ae commit 2eefbef
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scenarios/monitoring/cdp_monitoring/query_samples/README.md
Original file line number Diff line number Diff line change
@@ -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) |
Original file line number Diff line number Diff line change
@@ -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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2eefbef

Please sign in to comment.