There might be something in Acero, but this something I’ve been planning to work on..
https://github.com/apache/arrow/issues/39128 Parse formula into relationship operators. Wrap * operator with pc.multiply Wrap - operator with pc.subtract Etc. etc. ________________________________ From: Li Jin <ice.xell...@gmail.com> Sent: Friday, February 21, 2025 1:10:11 PM To: dev@arrow.apache.org <dev@arrow.apache.org> Subject: [Arrow Compute] Question on function chaining / math formular External Email: Use caution with links and attachments Dear Arrow Devs, I wonder if there is a nice way to do function chaining / math formular with Arrow compute? (Either Python or C++?) To give an example, let say I have three arrays a, x and y and want to compute: x * (1 - a) + y * a Right now I can do this in pyarrow but pretty hard to read: from pyarrow.compute import add, subtract, multiply result = add(multiply(x, subtract(1, a)), multiply(y, a)) And it is probably harder to do this in C++ because the Result<Datum> return type. I wonder if there is a better way to do this kind of computation? Thank you, Li This message may contain information that is confidential or privileged. If you are not the intended recipient, please advise the sender immediately and delete this message. See http://www.blackrock.com/corporate/compliance/email-disclaimers for further information. Please refer to http://www.blackrock.com/corporate/compliance/privacy-policy for more information about BlackRock’s Privacy Policy. For a list of BlackRock's office addresses worldwide, see http://www.blackrock.com/corporate/about-us/contacts-locations. © 2025 BlackRock, Inc. All rights reserved.