Skip to content

Instantly share code, notes, and snippets.

@samgqroberts
Last active October 8, 2018 21:02
Show Gist options
  • Save samgqroberts/248530623731441e1218633e4afe1582 to your computer and use it in GitHub Desktop.
Save samgqroberts/248530623731441e1218633e4afe1582 to your computer and use it in GitHub Desktop.
working thesis for golden attribute API input formats
{
"clusterDataset": {
"name": "my_dedup_project_published_clusters_with_data",
"groupingKey": "published_id",
},
"overrideRules": {
"default": {
"type": "PRIORITY",
"overrideDatasets": ["manual_overrides", "suggestions"], // defaults to rule output
"default": true,
},
"noSuggestions": {
"type": "PRIORITY",
"overrideDatasets": ["manual_overrides"],
},
},
"goldenAttributes": [
{
"attributeName": "ga_spend",
"consolidationRule": {
"type": "SUM",
"attribute": "spend"
}, // GROUP sum(to_double(spend)) BY published_id
"overrideRule": "default", // OPTIONAL b/c "default" is marked as default
},
{
"attributeName": "ga_address",
"consolidationRule": {
"type": "CUSTOM",
"expr": "mode(address_1) || mode(address_2)",
},
// overrideRule is the "default" rule
{
"attributeName": "ga_marital_status",
"consolidationRule": {
"type": "MOST_RECENT",
"dateAttribute": "date",
"valueAttribute": "marital_status",
}, // GROUP firstBy(marital_status, date) BY published_id (syntax is pending output of DEV-9345
"overrideRule": "noSuggestions",
},
{
// authoritative source ?? "same as" ??
},
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment