Skip to content

Commit

Permalink
Merge pull request #2308 from mabel-dev/#2307
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer authored Jan 25, 2025
2 parents 03364d1 + 1a6022c commit 4e39e9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion opteryx/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__build__ = 1030
__build__ = 1031

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 3 additions & 1 deletion opteryx/operators/aggregate_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ def build_aggregations(aggregators):
count_options = pyarrow.compute.CountOptions(mode="all")
else:
field_name = field_node.schema_column.identity
if aggregator.value == "COUNT" and aggregator.duplicate_treatment == "Distinct":
aggregator.value = "COUNT_DISTINCT"
function = AGGREGATORS[aggregator.value]
# if the array agg is distinct, base off that function instead
if aggregator.value == "ARRAY_AGG" and aggregator.duplicate_treatment == "Distinct":
if aggregator.value == "ARRAY_AGG" and aggregator.duplicate_treatment == "Distinct":
function = "distinct"
aggs.append((field_name, function, count_options))
column_map[aggregator.schema_column.identity] = f"{field_name}_{function}".replace(
Expand Down

0 comments on commit 4e39e9d

Please sign in to comment.