tobyhede opened a new pull request #1430:
URL: https://github.com/apache/arrow-datafusion/pull/1430
### Which issue does this PR close?
Addresses #1364 #1173
Several of the built-in function definitions are not setup correctly and the
functions cannot actually be used at all.
Adds a test suite for using most of the functions with a dataframe.
In order to try and catch errors like this in future, as well as provide
some extra documentation of intent, I've changed the helper macros to
explicitly accept arguments rather than use a fixed arity.
I've played with a couple of options for functions that have a mixed arity.
btrim, as an example has two forms:
```
btrim(string); // defaults to trim whitespace from string
btrim(string, characters); // trims the supplied characters from string
```
At the moment, functions with varied arity expect a Vec<Expr>
```
btrim(vec![col("a"), lit("ab")]);
```
Alternative I played with was using two different definitions:
```
btrim(string);
btrim_shars(string, characters);
```
We could also make these functions macros. Doing that would mean that some
functions would be functions, some macros. Felt a bit strange.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]