Fix initial aggregates insert

main
Kevin Belisle 2021-07-19 02:58:06 -04:00
parent a03bd8ff8d
commit f452a84863
1 changed files with 2 additions and 2 deletions

View File

@ -142,7 +142,7 @@ object StatisticsImporter {
ON Live."Type" = Agg."Type"
WHERE array_contains(array['minecraft:mined'], Live."Type")
GROUP BY Live."Type"
HAVING sum(Live."Value") <> max(Agg."Value");
HAVING sum(Live."Value") <> max(Agg."Value") OR max(Agg."Value") IS NULL;
INSERT INTO AGGREGATESTATISTICS ("Type", "Name", "Timestamp", "Value")
SELECT Live."Type",
@ -155,7 +155,7 @@ object StatisticsImporter {
WHERE array_contains(array['minecraft:animals_bred', 'minecraft:play_one_minute', 'minecraft:deaths', 'minecraft:player_kills', 'minecraft:aviate_one_cm', 'minecraft:boat_one_cm', 'minecraft:crouch_one_cm', 'minecraft:horse_one_cm', 'minecraft:minecart_one_cm', 'minecraft:sprint_one_cm', 'minecraft:strider_one_cm', 'minecraft:swim_one_cm', 'minecraft:walk_on_water_one_cm', 'minecraft:walk_one_cm', 'minecraft:walk_under_water_one_cm' ], Live."Name")
OR array_contains(array['minecraft:killed', 'minecraft:killed_by'], Live."Type")
GROUP BY Live."Type", Live."Name"
HAVING sum(Live."Value") <> max(Agg."Value");
HAVING sum(Live."Value") <> max(Agg."Value") OR max(Agg."Value") IS NULL;
""".trimIndent()
)
}