MCPcopy Create free account
hub / github.com/apache/arrow / test_hash_aggregate_udf_basic

Function test_hash_aggregate_udf_basic

python/pyarrow/tests/test_substrait.py:761–928  ·  view source on GitHub ↗
(varargs_agg_func_fixture)

Source from the content-addressed store, hash-verified

759
760@pytest.mark.numpy
761def test_hash_aggregate_udf_basic(varargs_agg_func_fixture):
762
763 test_table = pa.Table.from_pydict(
764 {"t": [1, 1, 1, 1, 2, 2, 2, 2],
765 "k": [1, 0, 0, 1, 0, 1, 0, 1],
766 "v1": [1, 2, 3, 4, 5, 6, 7, 8],
767 "v2": [1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 5.0]}
768 )
769
770 def table_provider(names, _):
771 return test_table
772
773 substrait_query = b"""
774{
775 "extensionUris": [
776 {
777 "extensionUriAnchor": 1,
778 "uri": "urn:arrow:substrait_simple_extension_function"
779 },
780 ],
781 "extensions": [
782 {
783 "extensionFunction": {
784 "extensionUriReference": 1,
785 "functionAnchor": 1,
786 "name": "sum_mean"
787 }
788 }
789 ],
790 "relations": [
791 {
792 "root": {
793 "input": {
794 "extensionSingle": {
795 "common": {
796 "emit": {
797 "outputMapping": [
798 0,
799 1,
800 2
801 ]
802 }
803 },
804 "input": {
805 "read": {
806 "baseSchema": {
807 "names": [
808 "t",
809 "k",
810 "v1",
811 "v2",
812 ],
813 "struct": {
814 "types": [
815 {
816 "i64": {
817 "nullability": "NULLABILITY_REQUIRED"
818 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected