Added support for setting the RefreshType of individual tables in the configuration.

This commit is contained in:
Preston Hervey 2018-12-17 16:04:16 -06:00
parent b6ed4a8506
commit b4e4f52f96
6 changed files with 214 additions and 179 deletions

View File

@ -1,33 +1,37 @@
{
"database": {
"name": "AdventureWorksAggsProvider_PH",
"tables": [
{
"name": "DimGeography",
"mode": "DirectQuery"
},
{
"name": "DimCustomer",
"mode": "DirectQuery"
},
{
"name": "DimDate",
"mode": "DirectQuery"
},
{
Products
Getting things ready ...
"name": "DimProductSubcategory",
"mode": "DirectQuery"
},
{
"name": "DimProductCategory",
"mode": "DirectQuery"
},
{
"name": "FactInternetSalesAgg",
"mode": "DirectQuery"
}
]
}
"database": {
"name": "AdventureWorksAggsProvider",
"tables": [
{
"name": "DimGeography",
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimCustomer",
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimDate",
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimProductSubcategory",
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimProductCategory",
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "FactInternetSalesAgg",
"mode": "DirectQuery",
"refreshType": "Full"
}
]
}
}

View File

@ -2,68 +2,74 @@
"database": {
"name": "AdventureWorksAggsProvider_PH",
"tables": [
{
"name": "DimGeography",
"mode": "Dual"
},
{
"name": "DimCustomer",
"mode": "Dual"
},
{
"name": "DimDate",
"mode": "Dual"
},
{
"name": "DimProductSubcategory",
"mode": "Dual"
},
{
"name": "DimProductCategory",
"mode": "Dual"
},
{
"name": "FactInternetSalesAgg",
"mode": "Import",
"aggregationRules": [
{
"aggTableColumn": "OrderDateKey",
"summarization": "GroupBy",
"detailTable": "FactInternetSales",
"detailTableColumn": "OrderDateKey"
{
"name": "DimGeography",
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "DimCustomer",
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "DimDate",
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "DimProductSubcategory",
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "DimProductCategory",
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "FactInternetSalesAgg",
"mode": "Import",
"refreshType": "Full",
"aggregationRules": [
{
"aggTableColumn": "OrderDateKey",
"summarization": "GroupBy",
"detailTable": "FactInternetSales",
"detailTableColumn": "OrderDateKey"
},
{
"aggTableColumn": "CustomerKey",
"summarization": "GroupBy",
"detailTable": "FactInternetSales",
"detailTableColumn": "CustomerKey"
{
"aggTableColumn": "CustomerKey",
"summarization": "GroupBy",
"detailTable": "FactInternetSales",
"detailTableColumn": "CustomerKey"
},
{
"aggTableColumn": "ProductSubcategoryKey",
"summarization": "GroupBy",
"detailTable": "DimProduct",
"detailTableColumn": "ProductSubcategoryKey"
{
"aggTableColumn": "ProductSubcategoryKey",
"summarization": "GroupBy",
"detailTable": "DimProduct",
"detailTableColumn": "ProductSubcategoryKey"
},
{
"aggTableColumn": "SalesAmount_Sum",
"summarization": "Sum",
"detailTable": "FactInternetSales",
"detailTableColumn": "SalesAmount"
{
"aggTableColumn": "SalesAmount_Sum",
"summarization": "Sum",
"detailTable": "FactInternetSales",
"detailTableColumn": "SalesAmount"
},
{
"aggTableColumn": "UnitPrice_Sum",
"summarization": "Min",
"detailTable": "FactInternetSales",
"detailTableColumn": "UnitPrice"
{
"aggTableColumn": "UnitPrice_Sum",
"summarization": "Min",
"detailTable": "FactInternetSales",
"detailTableColumn": "UnitPrice"
},
{
"aggTableColumn": "UnitPrice_Count",
"summarization": "Count",
"detailTable": "FactInternetSales",
"detailTableColumn": "UnitPrice"
{
"aggTableColumn": "UnitPrice_Count",
"summarization": "Count",
"detailTable": "FactInternetSales",
"detailTableColumn": "UnitPrice"
}
]
}
]
}
]
}
}

View File

@ -2,67 +2,73 @@
"database": {
"name": "AdventureWorksAggsProvider_PH",
"tables": [
{
"name": "DimGeography",
"mode": "Dual"
},
{
"name": "DimCustomer",
"mode": "Dual"
},
{
"name": "DimDate",
"mode": "Dual"
},
{
"name": "DimProductSubcategory",
"mode": "Dual"
},
{
"name": "DimProductCategory",
"mode": "Dual"
},
{
"name": "FactInternetSalesAgg",
"mode": "Import",
"aggregationRules": [
{
"aggTableColumn": "OrderDateKey",
"summarization": "GroupBy",
"detailTable": "FactInternetSales",
"detailTableColumn": "OrderDateKey"
},
{
"aggTableColumn": "CustomerKey",
"summarization": "GroupBy",
"detailTable": "FactInternetSales",
"detailTableColumn": "CustomerKey"
},
{
"aggTableColumn": "ProductSubcategoryKey",
"summarization": "GroupBy",
"detailTable": "DimProduct",
"detailTableColumn": "ProductSubcategoryKey"
},
{
"aggTableColumn": "SalesAmount_Sum",
"summarization": "Sum",
"detailTable": "FactInternetSales",
"detailTableColumn": "SalesAmount"
},
{
"aggTableColumn": "UnitPrice_Sum",
"summarization": "Sum",
"detailTable": "FactInternetSales",
"detailTableColumn": "UnitPrice"
},
{
"aggTableColumn": "FactInternetSales_Count",
"summarization": "CountTableRows",
"detailTable": "FactInternetSales"
}
]
}
{
"name": "DimGeography",
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "DimCustomer",
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "DimDate",
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "DimProductSubcategory",
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "DimProductCategory",
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "FactInternetSalesAgg",
"mode": "Import",
"refreshType": "Full",
"aggregationRules": [
{
"aggTableColumn": "OrderDateKey",
"summarization": "GroupBy",
"detailTable": "FactInternetSales",
"detailTableColumn": "OrderDateKey"
},
{
"aggTableColumn": "CustomerKey",
"summarization": "GroupBy",
"detailTable": "FactInternetSales",
"detailTableColumn": "CustomerKey"
},
{
"aggTableColumn": "ProductSubcategoryKey",
"summarization": "GroupBy",
"detailTable": "DimProduct",
"detailTableColumn": "ProductSubcategoryKey"
},
{
"aggTableColumn": "SalesAmount_Sum",
"summarization": "Sum",
"detailTable": "FactInternetSales",
"detailTableColumn": "SalesAmount"
},
{
"aggTableColumn": "UnitPrice_Sum",
"summarization": "Sum",
"detailTable": "FactInternetSales",
"detailTableColumn": "UnitPrice"
},
{
"aggTableColumn": "FactInternetSales_Count",
"summarization": "CountTableRows",
"detailTable": "FactInternetSales"
}
]
}
]
}
}

View File

@ -2,30 +2,36 @@
"database": {
"name": "AdventureWorksAggsProvider_PH",
"tables": [
{
"name": "DimGeography",
"mode": "DirectQuery"
},
{
"name": "DimCustomer",
"mode": "DirectQuery"
},
{
"name": "DimDate",
"mode": "DirectQuery"
},
{
"name": "DimProductSubcategory",
"mode": "DirectQuery"
},
{
"name": "DimProductCategory",
"mode": "DirectQuery"
},
{
"name": "FactInternetSalesAgg",
"mode": "DirectQuery"
}
]
{
"name": "DimGeography",
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimCustomer",
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimDate",
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimProductSubcategory",
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimProductCategory",
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "FactInternetSalesAgg",
"mode": "DirectQuery",
"refreshType": "Full"
}
]
}
}

View File

@ -66,6 +66,9 @@ namespace SetUpAggs
[JsonProperty("mode")]
public string Mode { get; set; }
[JsonProperty("refreshType")]
public string RefreshType { get; set; }
[JsonProperty("aggregationRules", NullValueHandling = NullValueHandling.Ignore)]
public AggregationRule[] AggregationRules { get; set; }
}
@ -411,7 +414,11 @@ namespace SetUpAggs
{
Console.ForegroundColor = ConsoleColor.White;
Console.Write($"Refreshing table [{tableObj.Name}] ");
tableObj.RequestRefresh(RefreshType.Full);
Table tableConfig = aggsConfig.Database.Tables.First(x => x.Name == tableObj.Name);
var refreshType = (RefreshType)Enum.Parse(typeof(RefreshType), tableConfig.RefreshType);
tableObj.RequestRefresh(refreshType);
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("COMPLETE");
}

View File

@ -29,27 +29,33 @@ SetUpAggs.exe apply -Server asazure://server/instance -ConfigFile AggsConfig.jso
"tables": [
{
"name": "DimGeography",
"mode": "Dual"
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "DimCustomer",
"mode": "Dual"
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "DimDate",
"mode": "Dual"
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "DimProductSubcategory",
"mode": "Dual"
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "DimProductCategory",
"mode": "Dual"
"mode": "Dual",
"refreshType": "Full"
},
{
"name": "FactInternetSalesAgg",
"mode": "Import",
"refreshType": "Full",
"aggregationRules": [
{
"aggTableColumn": "OrderDateKey",