Skip to content

Fix equality of parametrizable ArrayAgg function#17065

Merged
findepi merged 1 commit into
apache:mainfrom
findepi:findepi/fix-equality-of-parametrizable-arrayagg-function-439345
Aug 7, 2025
Merged

Fix equality of parametrizable ArrayAgg function#17065
findepi merged 1 commit into
apache:mainfrom
findepi:findepi/fix-equality-of-parametrizable-arrayagg-function-439345

Conversation

@findepi

@findepi findepi commented Aug 7, 2025

Copy link
Copy Markdown
Member

The ArrayAgg struct is stateful, therefore it must implement AggregateUDFImpl::equals and hash_value functions.

The `ArrayAgg` struct is stateful, therefore it must implement
`AggregateUDFImpl::equals` and `hash_value` functions.
self.doc()
}

udf_equals_hash!(AggregateUDFImpl);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the equal method also check is_input_pre_ordered ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should and that it does.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remind myself that this macro calls into the PartialEq method

self.doc()
}

udf_equals_hash!(AggregateUDFImpl);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remind myself that this macro calls into the PartialEq method

@alamb

alamb commented Aug 7, 2025

Copy link
Copy Markdown
Contributor

Thanks @findepi

@findepi
findepi merged commit a83237f into apache:main Aug 7, 2025
27 checks passed
@findepi
findepi deleted the findepi/fix-equality-of-parametrizable-arrayagg-function-439345 branch August 7, 2025 20:25
nuno-faria pushed a commit to nuno-faria/datafusion that referenced this pull request Aug 8, 2025
The `ArrayAgg` struct is stateful, therefore it must implement
`AggregateUDFImpl::equals` and `hash_value` functions.
LiaCastaneda pushed a commit to DataDog/datafusion that referenced this pull request Aug 12, 2025
The `ArrayAgg` struct is stateful, therefore it must implement
`AggregateUDFImpl::equals` and `hash_value` functions.
LiaCastaneda pushed a commit to DataDog/datafusion that referenced this pull request Aug 12, 2025
The `ArrayAgg` struct is stateful, therefore it must implement
`AggregateUDFImpl::equals` and `hash_value` functions.
alamb added a commit that referenced this pull request Aug 14, 2025
* fix: string_agg not respecting ORDER BY

* Fix equality of parametrizable ArrayAgg function (#17065)

The `ArrayAgg` struct is stateful, therefore it must implement
`AggregateUDFImpl::equals` and `hash_value` functions.

* Implement AggregateUDFImpl::equals and AggregateUDFImpl::hash_value for ArrayAgg

* Implement alternative fix

* Remove 'use std::any::Any'

* Add sqllogictest for string_agg plan

* Revert as_any to their original implementations

---------

Co-authored-by: Piotr Findeisen <piotr.findeisen@gmail.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
LiaCastaneda pushed a commit to DataDog/datafusion that referenced this pull request Aug 14, 2025
* fix: string_agg not respecting ORDER BY

* Fix equality of parametrizable ArrayAgg function (apache#17065)

The `ArrayAgg` struct is stateful, therefore it must implement
`AggregateUDFImpl::equals` and `hash_value` functions.

* Implement AggregateUDFImpl::equals and AggregateUDFImpl::hash_value for ArrayAgg

* Implement alternative fix

* Remove 'use std::any::Any'

* Add sqllogictest for string_agg plan

* Revert as_any to their original implementations

---------

Co-authored-by: Piotr Findeisen <piotr.findeisen@gmail.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
(cherry picked from commit f05b128)
LiaCastaneda added a commit to DataDog/datafusion that referenced this pull request Aug 14, 2025
* fix: string_agg not respecting ORDER BY

* Fix equality of parametrizable ArrayAgg function (apache#17065)

The `ArrayAgg` struct is stateful, therefore it must implement
`AggregateUDFImpl::equals` and `hash_value` functions.

* Implement AggregateUDFImpl::equals and AggregateUDFImpl::hash_value for ArrayAgg

* Implement alternative fix

* Remove 'use std::any::Any'

* Add sqllogictest for string_agg plan

* Revert as_any to their original implementations

---------



(cherry picked from commit f05b128)

Co-authored-by: Nuno Faria <nunofpfaria@gmail.com>
Co-authored-by: Piotr Findeisen <piotr.findeisen@gmail.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

2 participants