-
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
Move Entity/Underlay to EntityFilter #1137
Conversation
dexamundsen
commented
Jan 20, 2025
•
edited
Loading
edited
- Move Entity / Underlay to EntityFilter from child classes. this removes repeated definition in child classes
- add parent class constructor, equals and hashcode functions in EntityFilter, called from child classes
- replace more wild card imports by individual imports
- rename ITEntitySearchByAttribute to ITEntitySearchByAttributes (added s at the end) to keep it same as config field
- update index for aou_test underlay (changes variant_to_person to cb_variant_to_person)
- update util functions in entity and indexSchema to store AttributeName instead of Attribute for search by attribute (improves performance)
jobSet.addJob( | ||
new WriteEntitySearchByAttribute( | ||
new WriteEntitySearchByAttributes( |
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.
added s at the end (rename)
@@ -17,18 +17,18 @@ | |||
import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | |||
|
|||
public class WriteEntitySearchByAttribute extends BigQueryJob { | |||
private static final Logger LOGGER = LoggerFactory.getLogger(WriteEntitySearchByAttribute.class); | |||
public class WriteEntitySearchByAttributes extends BigQueryJob { |
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.
added s at the end (rename)
@@ -72,12 +77,14 @@ public static SequencedJobSet getJobSetForEntity( | |||
.getOptimizeSearchByAttributes() | |||
.forEach( | |||
searchTableAttributes -> { | |||
ITEntitySearchByAttribute searchTable = | |||
ITEntitySearchByAttributes searchTable = |
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.
added s at the end (rename)
|
||
public class AttributeFilter extends EntityFilter { | ||
private final Underlay underlay; |
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.
moved to parent class
@@ -3,15 +3,15 @@ | |||
"bigQuery": { | |||
"sourceData": { | |||
"projectId": "vwb-dev-blissful-eggplant-4805", | |||
"datasetId": "aou_test_data_SC2023Q3R2", | |||
"datasetId": "aou_test_data_SC2023Q3R2_011625", |
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.
same dataset for source and index
@@ -1,3 +1,3 @@ | |||
SELECT vid, ARRAY_LENGTH(person_ids) AS num_persons | |||
/* Wrap variant_to_person table in a SELECT DISTINCT because there is a duplicate row in the test data. */ | |||
FROM (SELECT DISTINCT vid, person_ids FROM `${omopDataset}.variant_to_person` WHERE REGEXP_CONTAINS(vid, r"{indexIdRegex}")) | |||
FROM (SELECT DISTINCT vid, person_ids FROM `${omopDataset}.cb_variant_to_person` WHERE REGEXP_CONTAINS(vid, r"{indexIdRegex}")) |
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.
changed in new source data
@@ -262,13 +262,13 @@ public TableResult runQuery( | |||
JobStatistics.QueryStatistics stats = completedJob.getStatistics(); | |||
Long totalBytesProcessed = stats.getTotalBytesProcessed(); | |||
String jobId = completedJob.getJobId().getJob(); | |||
LOGGER.info("job: {}, query: {}", jobId, sql); |
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.
combine logs
@@ -66,32 +66,13 @@ public ITEntityLevelDisplayHints getEntityLevelDisplayHints(String entity) { | |||
.orElseThrow(); | |||
} | |||
|
|||
// function used during indexing: when table clustered on all attributes are needed |
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.
combined to single function
@@ -42,6 +43,14 @@ public Entity( | |||
this.optimizeSearchByAttributes = | |||
ImmutableList.copyOf( | |||
optimizeSearchByAttributes.stream().map(ImmutableList::copyOf).toList()); | |||
this.optimizeSearchByAttributeNames = |
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.
improves performance in updates util function