ibis-project / ibis

the portable Python dataframe library
https://ibis-project.org
Apache License 2.0
5.16k stars 591 forks source link

Support OmniSci Sample method #1680

Closed saulshanabrook closed 5 years ago

saulshanabrook commented 5 years ago

OmniSci supports the SAMPLE aggregate method that:

Returns one sample value from aggregated column x.

I don't believe this is implemented in the Ibis wrapper.

saulshanabrook commented 5 years ago

cc @xmnlab

To implement this, would we:

saulshanabrook commented 5 years ago

I think Arbitrary could be the right operation: https://github.com/ibis-project/ibis/issues/1230

So we would just have to add a mapping to OmniSci to map this to sample

saulshanabrook commented 5 years ago

It looks like it is taking the last of groupby: https://github.com/omnisci/mapd-core/blob/ce5c83d782f30b0ef62dff98fff530fdd65e14d7/QueryEngine/Execute.cpp#L733-L740

saulshanabrook commented 5 years ago

I am working on adding this.

xmnlab commented 5 years ago

in the documentation:

Note: This was previously LAST_SAMPLE, which is now deprecated.

(https://www.omnisci.com/docs/latest/5_math.html#aggregate-function-support-1)

so a translation from arbitrary last to sample should works fine