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,32 +1,36 @@
{
"database": {
"name": "AdventureWorksAggsProvider_PH",
"name": "AdventureWorksAggsProvider",
"tables": [
{
"name": "DimGeography",
"mode": "DirectQuery"
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimCustomer",
"mode": "DirectQuery"
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimDate",
"mode": "DirectQuery"
"mode": "DirectQuery",
"refreshType": "Full"
},
{
Products
Getting things ready ...
"name": "DimProductSubcategory",
"mode": "DirectQuery"
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimProductCategory",
"mode": "DirectQuery"
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "FactInternetSalesAgg",
"mode": "DirectQuery"
"mode": "DirectQuery",
"refreshType": "Full"
}
]
}

View File

@ -4,27 +4,33 @@
"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",

View File

@ -4,27 +4,33 @@
"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",

View File

@ -4,27 +4,33 @@
"tables": [
{
"name": "DimGeography",
"mode": "DirectQuery"
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimCustomer",
"mode": "DirectQuery"
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimDate",
"mode": "DirectQuery"
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimProductSubcategory",
"mode": "DirectQuery"
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "DimProductCategory",
"mode": "DirectQuery"
"mode": "DirectQuery",
"refreshType": "Full"
},
{
"name": "FactInternetSalesAgg",
"mode": "DirectQuery"
"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",