Skip to content

Commit

Permalink
fix: assertion error on records-shard merge
Browse files Browse the repository at this point in the history
This issue was difficult to debug. Usually, GROUP BY would also return sorted data because PG sorts data by default when using GROUP By. Except that for small arrays, it doesn't sort. Adding excplicit sort order to make_shard_sql fixes #2
  • Loading branch information
Sieboldianus committed Feb 11, 2020
1 parent d92c6d2 commit 71cf51f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lbsntransform/output/hll/hll_functions.py
Expand Up @@ -85,6 +85,7 @@ def make_shard_sql(values_str: str) -> str:
VALUES {values_str}
) s(base_id, metric_id, item_value)
GROUP BY base_id, metric_id
ORDER BY base_id, metric_id
'''
return insert_sql

Expand Down

0 comments on commit 71cf51f

Please sign in to comment.