Skip to content

Commit

Permalink
Add SZRollupCounts to annotation processor list of classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
marikomedlock committed Sep 14, 2024
1 parent 4d14399 commit 777ee19
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
package bio.terra.tanagra.annotation;

import bio.terra.tanagra.underlay.serialization.SZAttribute;
import bio.terra.tanagra.underlay.serialization.SZBigQuery;
import bio.terra.tanagra.underlay.serialization.SZCorePlugin;
import bio.terra.tanagra.underlay.serialization.SZCriteriaOccurrence;
import bio.terra.tanagra.underlay.serialization.SZCriteriaSelector;
import bio.terra.tanagra.underlay.serialization.SZDataType;
import bio.terra.tanagra.underlay.serialization.SZEntity;
import bio.terra.tanagra.underlay.serialization.SZGroupItems;
import bio.terra.tanagra.underlay.serialization.SZHierarchy;
import bio.terra.tanagra.underlay.serialization.SZIndexer;
import bio.terra.tanagra.underlay.serialization.SZPrepackagedCriteria;
import bio.terra.tanagra.underlay.serialization.SZService;
import bio.terra.tanagra.underlay.serialization.SZTextSearch;
import bio.terra.tanagra.underlay.serialization.SZUnderlay;
import bio.terra.tanagra.underlay.serialization.SZVisualization;
import bio.terra.tanagra.underlay.serialization.*;
import java.util.List;

@SuppressWarnings("PMD.CouplingBetweenObjects")
Expand Down Expand Up @@ -52,6 +38,7 @@ public class UnderlayConfigPath extends AnnotationPath {
SZCriteriaSelector.Display.class,
SZCriteriaSelector.Modifier.class,
SZPrepackagedCriteria.class,
SZRollupCountsSql.class,
SZVisualization.class,
SZCorePlugin.class);

Expand Down
33 changes: 32 additions & 1 deletion docs/generated/UNDERLAY_CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This documentation is generated from annotations in the configuration classes.
* [SZPrepackagedCriteria](#szprepackagedcriteria)
* [SZPrimaryCriteriaRelationship](#szprimarycriteriarelationship)
* [SZPrimaryRelationship](#szprimaryrelationship)
* [SZRollupCountsSql](#szrollupcountssql)
* [SZService](#szservice)
* [SZSourceData](#szsourcedata)
* [SZSourceQuery](#szsourcequery)
Expand Down Expand Up @@ -670,7 +671,7 @@ Name of the entity group.
This is the unique identifier for the entity group. In a single underlay, the entity group names of any group type cannot overlap. Name may not include spaces or special characters, only letters and numbers. The first character must be a letter.

### SZGroupItems.rollupCountsSql
**optional** SZRollupCountsSql
**optional** [SZRollupCountsSql](#szrollupcountssql)

Pointer to SQL that returns entity id - rollup count (= number of related entity instances) pairs.

Expand Down Expand Up @@ -972,6 +973,36 @@ Name of the field or column name that maps to the primary entity id. Required if



## SZRollupCountsSql
Pointer to SQL that returns entity id - rollup count (= number of related entity instances) pairs (e.g. variant - number of people). Useful when there's an easy way to calculate these in SQL and we want to avoid ingesting the full entity - related entity relationship id pairs table into Dataflow.

### SZRollupCountsSql.entityIdFieldName
**required** String

Name of the field or column name that maps to the entity id.

*Example value:* `entity_id`

### SZRollupCountsSql.rollupCountFieldName
**required** String

Name of the field or column name that maps to the rollup count per entity id.

*Example value:* `rollup_count`

### SZRollupCountsSql.rollupCountsSqlFile
**required** String

Name of the entity id - rollup counts (= number of items entity instances) pairs SQL file.

File must be in the same directory as the entity/group file. Name includes file extension.

There can be other columns selected in the SQL file (e.g. `SELECT * FROM relationships`), but the entity id and rollup count fields are required.

*Example value:* `rollupCounts.sql`



## SZService
Service configuration.

Expand Down
8 changes: 7 additions & 1 deletion ui/src/tanagra-underlay/underlayConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export type SZGroupItems = {
itemsEntity: string;
itemsEntityIdFieldName?: string;
name: string;
rollupCountsSql?: szrollupcountssql;
rollupCountsSql?: SZRollupCountsSql;
useSourceIdPairsSql?: boolean;
};

Expand Down Expand Up @@ -177,6 +177,12 @@ export type SZPrimaryRelationship = {
primaryEntityIdFieldName?: string;
};

export type SZRollupCountsSql = {
entityIdFieldName: string;
rollupCountFieldName: string;
sqlFile: string;
};

export type SZService = {
bigQuery: SZBigQuery;
underlay: string;
Expand Down

0 comments on commit 777ee19

Please sign in to comment.