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

View File

@ -4,27 +4,33 @@
"tables": [ "tables": [
{ {
"name": "DimGeography", "name": "DimGeography",
"mode": "Dual" "mode": "Dual",
"refreshType": "Full"
}, },
{ {
"name": "DimCustomer", "name": "DimCustomer",
"mode": "Dual" "mode": "Dual",
"refreshType": "Full"
}, },
{ {
"name": "DimDate", "name": "DimDate",
"mode": "Dual" "mode": "Dual",
"refreshType": "Full"
}, },
{ {
"name": "DimProductSubcategory", "name": "DimProductSubcategory",
"mode": "Dual" "mode": "Dual",
"refreshType": "Full"
}, },
{ {
"name": "DimProductCategory", "name": "DimProductCategory",
"mode": "Dual" "mode": "Dual",
"refreshType": "Full"
}, },
{ {
"name": "FactInternetSalesAgg", "name": "FactInternetSalesAgg",
"mode": "Import", "mode": "Import",
"refreshType": "Full",
"aggregationRules": [ "aggregationRules": [
{ {
"aggTableColumn": "OrderDateKey", "aggTableColumn": "OrderDateKey",

View File

@ -4,27 +4,33 @@
"tables": [ "tables": [
{ {
"name": "DimGeography", "name": "DimGeography",
"mode": "Dual" "mode": "Dual",
"refreshType": "Full"
}, },
{ {
"name": "DimCustomer", "name": "DimCustomer",
"mode": "Dual" "mode": "Dual",
"refreshType": "Full"
}, },
{ {
"name": "DimDate", "name": "DimDate",
"mode": "Dual" "mode": "Dual",
"refreshType": "Full"
}, },
{ {
"name": "DimProductSubcategory", "name": "DimProductSubcategory",
"mode": "Dual" "mode": "Dual",
"refreshType": "Full"
}, },
{ {
"name": "DimProductCategory", "name": "DimProductCategory",
"mode": "Dual" "mode": "Dual",
"refreshType": "Full"
}, },
{ {
"name": "FactInternetSalesAgg", "name": "FactInternetSalesAgg",
"mode": "Import", "mode": "Import",
"refreshType": "Full",
"aggregationRules": [ "aggregationRules": [
{ {
"aggTableColumn": "OrderDateKey", "aggTableColumn": "OrderDateKey",

View File

@ -4,27 +4,33 @@
"tables": [ "tables": [
{ {
"name": "DimGeography", "name": "DimGeography",
"mode": "DirectQuery" "mode": "DirectQuery",
"refreshType": "Full"
}, },
{ {
"name": "DimCustomer", "name": "DimCustomer",
"mode": "DirectQuery" "mode": "DirectQuery",
"refreshType": "Full"
}, },
{ {
"name": "DimDate", "name": "DimDate",
"mode": "DirectQuery" "mode": "DirectQuery",
"refreshType": "Full"
}, },
{ {
"name": "DimProductSubcategory", "name": "DimProductSubcategory",
"mode": "DirectQuery" "mode": "DirectQuery",
"refreshType": "Full"
}, },
{ {
"name": "DimProductCategory", "name": "DimProductCategory",
"mode": "DirectQuery" "mode": "DirectQuery",
"refreshType": "Full"
}, },
{ {
"name": "FactInternetSalesAgg", "name": "FactInternetSalesAgg",
"mode": "DirectQuery" "mode": "DirectQuery",
"refreshType": "Full"
} }
] ]
} }

View File

@ -66,6 +66,9 @@ namespace SetUpAggs
[JsonProperty("mode")] [JsonProperty("mode")]
public string Mode { get; set; } public string Mode { get; set; }
[JsonProperty("refreshType")]
public string RefreshType { get; set; }
[JsonProperty("aggregationRules", NullValueHandling = NullValueHandling.Ignore)] [JsonProperty("aggregationRules", NullValueHandling = NullValueHandling.Ignore)]
public AggregationRule[] AggregationRules { get; set; } public AggregationRule[] AggregationRules { get; set; }
} }
@ -411,7 +414,11 @@ namespace SetUpAggs
{ {
Console.ForegroundColor = ConsoleColor.White; Console.ForegroundColor = ConsoleColor.White;
Console.Write($"Refreshing table [{tableObj.Name}] "); 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.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("COMPLETE"); Console.WriteLine("COMPLETE");
} }

View File

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