Skip to content

Commit

Permalink
Fix storage aggregator.
Browse files Browse the repository at this point in the history
The physical_usage column in the fact table is nullable, but the one in the
aggregates table is not. This updates the load SQL to coalesce the null to 0 if necessary.
  • Loading branch information
jpwhite4 committed Nov 22, 2024
1 parent 14ba8ef commit 77a0b94
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"avg_logical_usage": "AVG(sf.logical_usage)",
"sum_logical_usage": "SUM(CAST(sf.logical_usage AS DECIMAL(30,0)))",
"sum_squared_logical_usage": "SUM(CAST(sf.logical_usage AS DECIMAL(60,0)) * CAST(sf.logical_usage AS DECIMAL(60,0)))",
"avg_physical_usage": "AVG(sf.physical_usage)",
"sum_physical_usage": "SUM(CAST(sf.physical_usage AS DECIMAL(30,0)))",
"sum_squared_physical_usage": "SUM(CAST(sf.physical_usage AS DECIMAL(60,0)) * CAST(sf.physical_usage AS DECIMAL(60,0)))",
"avg_physical_usage": "AVG(COALESCE(sf.physical_usage, 0))",
"sum_physical_usage": "SUM(CAST(COALESCE(sf.physical_usage, 0) AS DECIMAL(30,0)))",
"sum_squared_physical_usage": "SUM(CAST(COALESCE(sf.physical_usage, 0) AS DECIMAL(60,0)) * CAST(COALESCE(sf.physical_usage, 0) AS DECIMAL(60,0)))",
"avg_soft_threshold": "AVG(sf.soft_threshold)",
"sum_soft_threshold": "SUM(CAST(sf.soft_threshold AS DECIMAL(30,0)))",
"avg_hard_threshold": "AVG(sf.hard_threshold)",
Expand Down

0 comments on commit 77a0b94

Please sign in to comment.